1 | %bcond_with systemd |
---|
2 | |
---|
3 | Summary: a high-performance, distributed memory object caching system |
---|
4 | Summary(ja): ハイパフォーマンスな分散メモリオブジェクトキャッシングシステム |
---|
5 | Name: memcached |
---|
6 | Version: 1.6.9 |
---|
7 | Release: 1%{?_dist_release}%{?with_systemd:.systemd} |
---|
8 | Group: servers |
---|
9 | Vendor: Project Vine |
---|
10 | Distribution: Vine Linux |
---|
11 | |
---|
12 | License: modified BSD style License |
---|
13 | Url: https://memcached.org/ |
---|
14 | Source0: http://www.memcached.org/files/memcached-%{version}.tar.gz |
---|
15 | Source1: memcached.sysconfig |
---|
16 | # Patches |
---|
17 | Patch1: memcached-unit.patch |
---|
18 | |
---|
19 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
---|
20 | BuildRequires: libevent-devel |
---|
21 | BuildRequires: openssl-devel |
---|
22 | Requires(pre): shadow-utils |
---|
23 | %if %{with systemd} |
---|
24 | BuildRequires: systemd |
---|
25 | %{?systemd_requires} |
---|
26 | %else |
---|
27 | Requires(post): chkconfig |
---|
28 | Requires(preun): chkconfig |
---|
29 | Requires(preun): initscripts |
---|
30 | Requires(postun): initscripts |
---|
31 | %endif |
---|
32 | |
---|
33 | %description |
---|
34 | memcached is a high-performance, distributed memory object caching system, |
---|
35 | generic in nature, but intended for use in speeding up dynamic web |
---|
36 | applications by alleviating database load. |
---|
37 | |
---|
38 | |
---|
39 | %package devel |
---|
40 | Summary: Files needed for development using memcached protocol |
---|
41 | Summary(ja): memcached プロトコルを使用した開発に必要なファイル |
---|
42 | Group: programming |
---|
43 | Requires: %{name} = %{version}-%{release} |
---|
44 | |
---|
45 | %description devel |
---|
46 | Install memcached-devel if you are developing C/C++ applications that require access to the |
---|
47 | memcached binary include files. |
---|
48 | |
---|
49 | |
---|
50 | %debug_package |
---|
51 | |
---|
52 | |
---|
53 | %prep |
---|
54 | %setup -q |
---|
55 | %patch1 -p1 -b .unit |
---|
56 | |
---|
57 | %if !%{with systemd} |
---|
58 | perl -pi -e 's|/var/run/memcached\.pid|/var/run/memcached/memcached.pid|' scripts/memcached.sysv |
---|
59 | %endif |
---|
60 | |
---|
61 | |
---|
62 | %build |
---|
63 | %configure --enable-tls |
---|
64 | %__make %{?_smp_mflags} |
---|
65 | |
---|
66 | |
---|
67 | %install |
---|
68 | rm -rf %{buildroot} |
---|
69 | mkdir -p %{buildroot}%{_sysconfdir}/sysconfig |
---|
70 | mkdir -p %{buildroot}%{_localstatedir}/run/memcached |
---|
71 | |
---|
72 | make install DESTDIR=%{buildroot} INSTALL="%{__install} -p" |
---|
73 | # remove memcached-debug |
---|
74 | rm -f %{buildroot}/%{_bindir}/memcached-debug |
---|
75 | |
---|
76 | # Perl script for monitoring memcached |
---|
77 | install -Dp -m0755 scripts/memcached-tool %{buildroot}%{_bindir}/memcached-tool |
---|
78 | install -Dp -m0644 scripts/memcached-tool.1 \ |
---|
79 | %{buildroot}%{_mandir}/man1/memcached-tool.1 |
---|
80 | |
---|
81 | %if %{with systemd} |
---|
82 | # Unit file |
---|
83 | install -Dp -m0644 scripts/memcached.service \ |
---|
84 | %{buildroot}%{_unitdir}/memcached.service |
---|
85 | %else |
---|
86 | mkdir -p %{buildroot}%{_initdir} |
---|
87 | install -m755 scripts/memcached.sysv %{buildroot}%{_initdir}/memcached |
---|
88 | %endif |
---|
89 | # Default configs |
---|
90 | install -Dp -m0644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/sysconfig/%{name} |
---|
91 | |
---|
92 | |
---|
93 | %clean |
---|
94 | rm -rf %{buildroot} |
---|
95 | |
---|
96 | |
---|
97 | %triggerprein -- memcached < 1.5.0 |
---|
98 | /sbin/update-alternatives --remove memcached %{_bindir}/memcached.memcached ||: |
---|
99 | /sbin/update-alternatives --remove memcached %{_bindir}/memcached.repcached ||: |
---|
100 | rm -f %{_bindir}/memcached |
---|
101 | |
---|
102 | %pre |
---|
103 | getent group memcached >/dev/null || groupadd -r memcached |
---|
104 | getent passwd memcached >/dev/null || \ |
---|
105 | useradd -r -g memcached -d %{_sysconfdir}/memcached -s /sbin/nologin \ |
---|
106 | -c "memcached service" memcached |
---|
107 | exit 0 |
---|
108 | |
---|
109 | %post |
---|
110 | %if %{with systemd} |
---|
111 | %systemd_post memcached.service |
---|
112 | %else |
---|
113 | /sbin/chkconfig --add %{name} |
---|
114 | %endif |
---|
115 | |
---|
116 | %preun |
---|
117 | %if %{with systemd} |
---|
118 | %systemd_preun memcached.service |
---|
119 | %else |
---|
120 | if [ "$1" -eq 0 -o -x /bin/systemctl ]; then |
---|
121 | /sbin/service %{name} stop >/dev/null 2>&1 |
---|
122 | /sbin/chkconfig --del %{name} |
---|
123 | fi |
---|
124 | %endif |
---|
125 | |
---|
126 | %postun |
---|
127 | %if %{with systemd} |
---|
128 | %systemd_postun_with_restart memcached.service |
---|
129 | %else |
---|
130 | if [ "$1" -ge "1" -a ! -x /bin/systemctl ]; then |
---|
131 | /sbin/service %{name} condrestart ||: |
---|
132 | fi |
---|
133 | %endif |
---|
134 | |
---|
135 | |
---|
136 | %files |
---|
137 | %defattr(-,root,root) |
---|
138 | %license COPYING |
---|
139 | %doc AUTHORS* ChangeLog ChangeLog* NEWS README* |
---|
140 | %doc doc/CONTRIBUTORS doc/*.txt |
---|
141 | %config(noreplace) %{_sysconfdir}/sysconfig/memcached |
---|
142 | %{_bindir}/memcached |
---|
143 | %{_bindir}/memcached-tool |
---|
144 | %{_mandir}/man1/memcached.1* |
---|
145 | %{_mandir}/man1/memcached-tool.1* |
---|
146 | %if %{with systemd} |
---|
147 | %{_unitdir}/memcached.service |
---|
148 | %else |
---|
149 | %{_initdir}/memcached |
---|
150 | %dir %{_localstatedir}/run/memcached |
---|
151 | %endif |
---|
152 | |
---|
153 | %files devel |
---|
154 | %defattr(-,root,root,0755) |
---|
155 | %{_includedir}/memcached/* |
---|
156 | |
---|
157 | %changelog |
---|
158 | * Sat Dec 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.6.9-1 |
---|
159 | - new upstream release. |
---|
160 | |
---|
161 | * Tue Apr 14 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.6.5-1 |
---|
162 | - new upstream release. |
---|
163 | - built with libevent-2.1.11. |
---|
164 | - added systemd support (disabled as default). |
---|
165 | |
---|
166 | * Sun Nov 04 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.5.12-1 |
---|
167 | - new upstream release. |
---|
168 | - built with libevent-2.1.8. |
---|
169 | - dropped repcached. |
---|
170 | |
---|
171 | * Mon Nov 23 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.25-1 |
---|
172 | - new upstream release. |
---|
173 | |
---|
174 | * Mon Jul 27 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.24-1 |
---|
175 | - new upstream release. |
---|
176 | |
---|
177 | * Fri Jan 10 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.17-1 |
---|
178 | - new upstream release. |
---|
179 | |
---|
180 | * Fri May 11 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.13-2 |
---|
181 | - fixed missing symlink. |
---|
182 | |
---|
183 | * Sat Apr 28 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.13-1 |
---|
184 | - new upstream release. |
---|
185 | - made be able to choose between memcached and repcached by alternatives. |
---|
186 | |
---|
187 | * Sat Aug 20 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.7.repcached2.3.1-1 |
---|
188 | - new upstream release. |
---|
189 | - updated repcached patch. |
---|
190 | - removed %%Patch0. (fixed in upstream) |
---|
191 | |
---|
192 | * Tue Feb 15 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.5.repcached2.3.1-1 |
---|
193 | - updated repcached patch. |
---|
194 | |
---|
195 | * Mon Feb 14 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.5.repcached2. |
---|
196 | 3-1 |
---|
197 | - applied the repcached patch. |
---|
198 | |
---|
199 | * Thu Feb 10 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.4.5-1 |
---|
200 | - new upstream release |
---|
201 | - added Patch0 from Fedora |
---|
202 | - rebuilt with libevent-2.0.10 |
---|
203 | - fixed &&files |
---|
204 | - splitted -devel package |
---|
205 | |
---|
206 | * Mon Jun 22 2009 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.2.8-1 |
---|
207 | - new upstream release. |
---|
208 | - wrote spec in UTF-8. |
---|
209 | |
---|
210 | * Mon May 19 2008 Tomohiro 'Tomo-p' KATO <tomop@teamgedoh.net> 1.2.5-1 |
---|
211 | - new upstream release. |
---|
212 | - added some scripts. |
---|
213 | |
---|
214 | * Mon Jul 16 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.1.12-0vl2 |
---|
215 | - rebuilt with libevent-1.3b |
---|
216 | |
---|
217 | * Sun Aug 13 2006 IWAI, Masaharu <iwai@alib.jp> 1.1.12-0vl1 |
---|
218 | - new package |
---|
219 | |
---|