1 | %define memcached_version 1.4.13 |
---|
2 | %define repcached_version 2.3.1 |
---|
3 | |
---|
4 | Summary: a high-performance, distributed memory object caching system |
---|
5 | Summary(ja): ハイパフォーマンスな分散メモリオブジェクトキャッシングシステム |
---|
6 | Name: memcached |
---|
7 | Version: %{memcached_version} |
---|
8 | Release: 1%{?_dist_release} |
---|
9 | Source0: http://www.danga.com/memcached/dist/%{name}-%{memcached_version}.tar.gz |
---|
10 | Source1: repcached-%{repcached_version}-%{memcached_version}.tar.gz |
---|
11 | |
---|
12 | # Patches |
---|
13 | |
---|
14 | # repcached patch |
---|
15 | Patch1: repcached-%{repcached_version}-%{memcached_version}.patch |
---|
16 | |
---|
17 | License: modified BSD style License |
---|
18 | Url: http://www.danga.com/memcached/ |
---|
19 | Group: Applications/Databases |
---|
20 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
---|
21 | BuildRequires: libevent-devel |
---|
22 | |
---|
23 | %description |
---|
24 | memcached is a high-performance, distributed memory object caching system, |
---|
25 | generic in nature, but intended for use in speeding up dynamic web |
---|
26 | applications by alleviating database load. |
---|
27 | |
---|
28 | %package devel |
---|
29 | Summary: Files needed for development using memcached protocol |
---|
30 | Summary(ja): memcached プロトコルを使用した開発に必要なファイル |
---|
31 | Group: Development/Libraries |
---|
32 | Requires: %{name} = %{version}-%{release} |
---|
33 | |
---|
34 | %description devel |
---|
35 | Install memcached-devel if you are developing C/C++ applications that require access to the |
---|
36 | memcached binary include files. |
---|
37 | |
---|
38 | %prep |
---|
39 | %setup -q -T -a 0 -c -n memcached-%{memcached_version} |
---|
40 | |
---|
41 | pushd memcached-%{memcached_version} |
---|
42 | |
---|
43 | popd |
---|
44 | |
---|
45 | %setup -q -D -T -a 1 -n memcached-%{memcached_version} |
---|
46 | |
---|
47 | pushd repcached-%{repcached_version}-%{memcached_version} |
---|
48 | |
---|
49 | popd |
---|
50 | |
---|
51 | %build |
---|
52 | pushd memcached-%{memcached_version} |
---|
53 | #sh ./autogen.sh |
---|
54 | %configure |
---|
55 | %__make %{?_smp_mflags} |
---|
56 | popd |
---|
57 | |
---|
58 | pushd repcached-%{repcached_version}-%{memcached_version} |
---|
59 | sh ./autogen.sh |
---|
60 | %configure --enable-replication |
---|
61 | %__make %{?_smp_mflags} |
---|
62 | popd |
---|
63 | |
---|
64 | %install |
---|
65 | rm -rf %{buildroot} |
---|
66 | mkdir -p %{buildroot}%{_initdir} |
---|
67 | mkdir -p %{buildroot}%{_sysconfdir}/sysconfig |
---|
68 | mkdir -p %{buildroot}%{_localstatedir}/run/memcached |
---|
69 | |
---|
70 | pushd memcached-%{memcached_version} |
---|
71 | %makeinstall |
---|
72 | |
---|
73 | rm -f %{buildroot}%{_bindir}/memcached-debug |
---|
74 | |
---|
75 | install -m755 scripts/memcached.sysv %{buildroot}%{_initdir}/memcached |
---|
76 | install -m755 scripts/memcached-tool %{buildroot}%{_bindir}/ |
---|
77 | |
---|
78 | popd |
---|
79 | |
---|
80 | pushd repcached-%{repcached_version}-%{memcached_version} |
---|
81 | cp -af AUTHORS COPYING ChangeLog ChangeLog.repcached NEWS README doc ../ |
---|
82 | popd |
---|
83 | |
---|
84 | mv -f %{buildroot}%{_bindir}/memcached %{buildroot}%{_bindir}/memcached.memcached |
---|
85 | install -m755 repcached-%{repcached_version}-%{memcached_version}/memcached %{buildroot}%{_bindir}/memcached.repcached |
---|
86 | |
---|
87 | cat <<EOF > %{buildroot}%{_sysconfdir}/sysconfig/memcached |
---|
88 | PORT=11211 |
---|
89 | USER=nobody |
---|
90 | MAXCONN=1024 |
---|
91 | CACHESIZE=64 |
---|
92 | OPTIONS="" |
---|
93 | #OPTIONS="-x peer.to.replicate" |
---|
94 | EOF |
---|
95 | |
---|
96 | %clean |
---|
97 | rm -rf %{buildroot} |
---|
98 | |
---|
99 | %post |
---|
100 | /sbin/update-alternatives --install %{_bindir}/memcached \ |
---|
101 | memcached %{_bindir}/memcached.memcached 20 |
---|
102 | /sbin/update-alternatives --install %{_bindir}/memcached \ |
---|
103 | memcached %{_bindir}/memcached.repcached 10 |
---|
104 | |
---|
105 | %preun |
---|
106 | if [ "$1" = 0 ]; then |
---|
107 | /sbin/update-alternatives --remove memcached %{_bindir}/memcached.memcached |
---|
108 | /sbin/update-alternatives --remove memcached %{_bindir}/memcached.repcached |
---|
109 | /sbin/update-alternatives --auto memcached ||: |
---|
110 | fi |
---|
111 | |
---|
112 | %files |
---|
113 | %defattr(-,root,root) |
---|
114 | %doc AUTHORS COPYING ChangeLog ChangeLog.repcached NEWS README |
---|
115 | %doc doc/CONTRIBUTORS doc/*.txt |
---|
116 | %config(noreplace) %{_sysconfdir}/sysconfig/memcached |
---|
117 | %{_initdir}/memcached |
---|
118 | %{_bindir}/memcached.memcached |
---|
119 | %{_bindir}/memcached.repcached |
---|
120 | %{_bindir}/memcached-tool |
---|
121 | %{_mandir}/man1/memcached.1* |
---|
122 | %dir %{_localstatedir}/run/memcached |
---|
123 | |
---|
124 | %files devel |
---|
125 | %defattr(-,root,root,0755) |
---|
126 | %{_includedir}/memcached/* |
---|
127 | |
---|
128 | %changelog |
---|
129 | * Sat Apr 28 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.13-1 |
---|
130 | - new upstream release. |
---|
131 | - made be able to choose between memcached and repcached by alternatives. |
---|
132 | |
---|
133 | * Sat Aug 20 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.7.repcached2.3.1-1 |
---|
134 | - new upstream release. |
---|
135 | - updated repcached patch. |
---|
136 | - removed %%Patch0. (fixed in upstream) |
---|
137 | |
---|
138 | * Tue Feb 15 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.5.repcached2.3.1-1 |
---|
139 | - updated repcached patch. |
---|
140 | |
---|
141 | * Mon Feb 14 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.5.repcached2. |
---|
142 | 3-1 |
---|
143 | - applied the repcached patch. |
---|
144 | |
---|
145 | * Thu Feb 10 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.4.5-1 |
---|
146 | - new upstream release |
---|
147 | - added Patch0 from Fedora |
---|
148 | - rebuilt with libevent-2.0.10 |
---|
149 | - fixed &&files |
---|
150 | - splitted -devel package |
---|
151 | |
---|
152 | * Mon Jun 22 2009 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.2.8-1 |
---|
153 | - new upstream release. |
---|
154 | - wrote spec in UTF-8. |
---|
155 | |
---|
156 | * Mon May 19 2008 Tomohiro 'Tomo-p' KATO <tomop@teamgedoh.net> 1.2.5-1 |
---|
157 | - new upstream release. |
---|
158 | - added some scripts. |
---|
159 | |
---|
160 | * Mon Jul 16 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.1.12-0vl2 |
---|
161 | - rebuilt with libevent-1.3b |
---|
162 | |
---|
163 | * Sun Aug 13 2006 IWAI, Masaharu <iwai@alib.jp> 1.1.12-0vl1 |
---|
164 | - new package |
---|
165 | |
---|