]>
Commit | Line | Data |
---|---|---|
52ff2772 | 1 | # |
66c7fa65 ER |
2 | # Conditional build: |
3 | %bcond_with tests # build with tests | |
4 | %bcond_without tests # build without tests | |
52ff2772 | 5 | # |
e8b9df06 | 6 | Summary: - |
ce39d734 | 7 | Summary(pl.UTF-8): - |
5e539df2 ER |
8 | Name: template |
9 | Version: _ | |
c1981b58 | 10 | Release: 0.1 |
72aa6361 | 11 | License: - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here) |
4b97f9d0 | 12 | Group: Applications |
e4db0ab6 | 13 | # SF URL: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz |
f1b2d418 | 14 | Source0: %{name}-%{version}.tar.gz |
023a0cc4 | 15 | # Source0-md5: - |
4b97f9d0 | 16 | #Source1: - |
023a0cc4 | 17 | # Source1-md5: - |
49683e54 | 18 | #Patch0: %{name}-DESTDIR.patch |
e8b9df06 | 19 | URL: - |
c0c12927 ER |
20 | %if %{with initscript} |
21 | BuildRequires: rpmbuild(macros) >= 1.228 | |
c0c12927 | 22 | Requires(post,preun): /sbin/chkconfig |
b411d35c | 23 | Requires: rc-scripts |
c0c12927 | 24 | %endif |
87302e56 JR |
25 | %if %{with systemd_service} |
26 | BuildRequires: rpmbuild(macros) >= 1.647 | |
27 | Requires(post,preun,postun): systemd-units >= 38 | |
28 | Requires: systemd-units >= 0.38 | |
29 | %endif | |
5e539df2 | 30 | #BuildRequires: - |
6d0e4f88 | 31 | #BuildRequires: autoconf |
fdeb11aa | 32 | #BuildRequires: automake |
bd5b2cfe | 33 | #BuildRequires: intltool |
6d0e4f88 | 34 | #BuildRequires: libtool |
5e539df2 | 35 | #Requires(postun): - |
4b97f9d0 ER |
36 | #Requires(pre,post): - |
37 | #Requires(preun): - | |
4b97f9d0 | 38 | #Requires: - |
44d5bb3a | 39 | #Provides: - |
c0c12927 ER |
40 | #Provides: group(foo) |
41 | #Provides: user(foo) | |
4b97f9d0 ER |
42 | #Obsoletes: - |
43 | #Conflicts: - | |
c1981b58 | 44 | #BuildArch: noarch |
5e539df2 | 45 | #ExclusiveArch: %{ix86} |
e8b9df06 SZ |
46 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
47 | ||
48 | %description | |
49 | ||
9be49f18 | 50 | %description -l pl.UTF-8 |
e8b9df06 | 51 | |
352b3a3c TP |
52 | %package subpackage |
53 | Summary: - | |
ce39d734 | 54 | Summary(pl.UTF-8): - |
352b3a3c | 55 | Group: - |
2c0f2034 ER |
56 | # noarch subpackages only when building with rpm5 |
57 | %if "%{_rpmversion}" >= "5" | |
58 | BuildArch: noarch | |
59 | %endif | |
352b3a3c TP |
60 | |
61 | %description subpackage | |
62 | ||
9be49f18 | 63 | %description subpackage -l pl.UTF-8 |
352b3a3c | 64 | |
5261abf9 ER |
65 | %package libs |
66 | Summary: - | |
ce39d734 | 67 | Summary(pl.UTF-8): - |
5261abf9 ER |
68 | Group: Libraries |
69 | ||
70 | %description libs | |
71 | ||
9be49f18 | 72 | %description libs -l pl.UTF-8 |
5261abf9 | 73 | |
88a5dbe9 | 74 | %package devel |
ca8abdb7 TP |
75 | Summary: Header files for %{name} library |
76 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki %{name} | |
88a5dbe9 | 77 | Group: Development/Libraries |
9a2e1218 | 78 | # if base package contains shared library for which these headers are |
49683e54 | 79 | #Requires: %{name} = %{version}-%{release} |
9a2e1218 JB |
80 | # if -libs package contains shared library for which these headers are |
81 | #Requires: %{name}-libs = %{version}-%{release} | |
88a5dbe9 ER |
82 | |
83 | %description devel | |
ca8abdb7 | 84 | Header files for %{name} library. |
c934cc1b | 85 | |
9be49f18 | 86 | %description devel -l pl.UTF-8 |
ca8abdb7 | 87 | Pliki nagłówkowe biblioteki %{name}. |
88a5dbe9 ER |
88 | |
89 | %package static | |
ca8abdb7 TP |
90 | Summary: Static %{name} library |
91 | Summary(pl.UTF-8): Statyczna biblioteka %{name} | |
88a5dbe9 | 92 | Group: Development/Libraries |
c0c12927 | 93 | Requires: %{name}-devel = %{version}-%{release} |
88a5dbe9 ER |
94 | |
95 | %description static | |
28aa1722 | 96 | Static %{name} library. |
c0c12927 | 97 | |
9be49f18 | 98 | %description static -l pl.UTF-8 |
28aa1722 | 99 | Statyczna biblioteka %{name}. |
c934cc1b | 100 | |
e8b9df06 | 101 | %prep |
c0c12927 ER |
102 | %setup -q |
103 | #%setup -q -c -T | |
104 | #%setup -q -n %{name} | |
10428dcb | 105 | #%setup -q -n %{name}-%{version}.orig -a 1 |
4b97f9d0 | 106 | #%patch0 -p1 |
e8b9df06 | 107 | |
c0c12927 | 108 | # undos the source |
5309e6bb | 109 | #find '(' -name '*.php' -o -name '*.inc' ')' -print0 | xargs -0 %{__sed} -i -e 's,\r$,,' |
c0c12927 ER |
110 | |
111 | # remove CVS control files | |
112 | #find -name CVS -print0 | xargs -0 rm -rf | |
113 | ||
c2bc0219 ER |
114 | # you'll need this if you cp -a complete dir in source |
115 | # cleanup backups after patching | |
53eee976 | 116 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f |
c2bc0219 | 117 | |
e8b9df06 | 118 | %build |
c42a30cf JB |
119 | # if ac/am/* rebuilding is necessary, do it in this order and add |
120 | # appropriate BuildRequires | |
ee7be565 ER |
121 | #%{__intltoolize} |
122 | #%{__gettextize} | |
123 | #%{__libtoolize} | |
124 | #%{__aclocal} | |
125 | #%{__autoconf} | |
126 | #%{__autoheader} | |
127 | #%{__automake} | |
f5f1d924 | 128 | # if not running libtool or automake, but config.sub is too old: |
de41dae9 | 129 | #cp -f /usr/share/automake/config.sub . |
19bf1c4b | 130 | %configure |
e8b9df06 SZ |
131 | %{__make} |
132 | ||
c0c12927 ER |
133 | #%{__make} \ |
134 | # CFLAGS="%{rpmcflags}" \ | |
135 | # LDFLAGS="%{rpmldflags}" | |
136 | ||
a5f05060 ER |
137 | %{?with_tests:%{__make} test} |
138 | ||
e8b9df06 SZ |
139 | %install |
140 | rm -rf $RPM_BUILD_ROOT | |
d43856e1 JB |
141 | # create directories if necessary |
142 | #install -d $RPM_BUILD_ROOT | |
b411d35c ER |
143 | %if %{with initscript} |
144 | install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d} | |
145 | %endif | |
c0c12927 | 146 | #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
e8b9df06 | 147 | |
a984843b SP |
148 | %{__make} install \ |
149 | DESTDIR=$RPM_BUILD_ROOT | |
e8b9df06 | 150 | |
f5bb3874 JB |
151 | %clean |
152 | rm -rf $RPM_BUILD_ROOT | |
153 | ||
e8b9df06 | 154 | %pre |
ba57de51 ER |
155 | %groupadd -g xxx %{name} |
156 | %useradd -u xxx -d /var/lib/%{name} -g %{name} -c "XXX User" %{name} | |
e8b9df06 | 157 | |
e8b9df06 SZ |
158 | %post |
159 | ||
b187ef53 JB |
160 | %preun |
161 | ||
e8b9df06 | 162 | %postun |
ba57de51 ER |
163 | if [ "$1" = "0" ]; then |
164 | %userremove %{name} | |
165 | %groupremove %{name} | |
166 | fi | |
c0c12927 ER |
167 | |
168 | %if %{with ldconfig} | |
169 | %post -p /sbin/ldconfig | |
170 | %postun -p /sbin/ldconfig | |
171 | %endif | |
172 | ||
173 | %if %{with initscript} | |
87302e56 | 174 | %post |
c0c12927 ER |
175 | /sbin/chkconfig --add %{name} |
176 | %service %{name} restart | |
177 | ||
87302e56 | 178 | %preun |
c0c12927 ER |
179 | if [ "$1" = "0" ]; then |
180 | %service -q %{name} stop | |
181 | /sbin/chkconfig --del %{name} | |
182 | fi | |
183 | %endif | |
e8b9df06 | 184 | |
87302e56 JR |
185 | %if %{with systemd_service} |
186 | %post | |
187 | %systemd_post %{name}.service | |
188 | ||
189 | %preun | |
190 | %systemd_preun %{name}.service | |
191 | ||
192 | %postun | |
193 | %systemd_reload | |
194 | %endif | |
195 | ||
e8b9df06 SZ |
196 | %files |
197 | %defattr(644,root,root,755) | |
5dda8307 | 198 | %doc AUTHORS CREDITS CHANGES ChangeLog NEWS README THANKS TODO |
cec32492 | 199 | |
5e539df2 | 200 | %if 0 |
11877175 ER |
201 | # if _sysconfdir != /etc: |
202 | #%%dir %{_sysconfdir} | |
9c3f0ed0 | 203 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/* |
28aa1722 | 204 | %attr(755,root,root) %{_bindir}/%{name}* |
0b279ca0 | 205 | %{_datadir}/%{name} |
5e539df2 | 206 | %endif |
f1b2d418 | 207 | |
d1184c8c | 208 | # initscript and its config |
5e539df2 | 209 | %if %{with initscript} |
2482ba2c | 210 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
9c3f0ed0 | 211 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |
5e539df2 | 212 | %endif |
2482ba2c | 213 | |
87302e56 JR |
214 | %if %{with systemd_service} |
215 | %{systemdunitdir}/%{name}.service | |
216 | %endif | |
217 | ||
c0c12927 ER |
218 | #%{_examplesdir}/%{name}-%{version} |
219 | ||
49683e54 | 220 | %if %{with subpackage} |
f1b2d418 TP |
221 | %files subpackage |
222 | %defattr(644,root,root,755) | |
5e539df2 ER |
223 | #%doc extras/*.gz |
224 | #%{_datadir}/%{name}-ext | |
49683e54 | 225 | %endif |