]> git.pld-linux.org Git - projects/template-specs.git/blob - template.spec
32c9f37cc1860c897773d7cc683a110c8c730f04
[projects/template-specs.git] / template.spec
1 #
2 # Conditional build:
3 %bcond_with     tests           # build with tests
4 %bcond_without  tests           # build without tests
5 #
6 Summary:        -
7 Summary(pl.UTF-8):      -
8 Name:           template
9 Version:        _
10 Release:        0.1
11 License:        - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here)
12 Group:          Applications
13 # SF URL: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
14 # github URL https://github.com/USER/PROJECT/archive/v%{version}/%{name}-%{version}.tar.gz
15 Source0:        %{name}-%{version}.tar.gz
16 # Source0-md5:  -
17 #Source1:       -
18 # Source1-md5:  -
19 #Patch0:                %{name}-DESTDIR.patch
20 URL:            -
21 # if using noarch subpackage
22 #BuildRequires: rpm-build >= 4.6
23 %if %{with initscript}
24 BuildRequires:  rpmbuild(macros) >= 1.228
25 Requires(post,preun):   /sbin/chkconfig
26 Requires:       rc-scripts
27 %endif
28 %if %{with systemd_service}
29 BuildRequires:  rpmbuild(macros) >= 2.011
30 Requires(post,preun,postun):    systemd-units >= 250.1
31 Requires:       systemd-units >= 250.1
32 %endif
33 %if %{with systemd_user_service}
34 BuildRequires:  rpmbuild(macros) >= 2.011
35 Requires(post,preun):   systemd-units >= 250.1
36 Requires:       systemd-units >= 250.1
37 %endif
38 #BuildRequires: -
39 #BuildRequires: autoconf
40 #BuildRequires: automake
41 #BuildRequires: intltool
42 #BuildRequires: libtool
43 #Requires(postun):      -
44 #Requires(pre,post):    -
45 #Requires(preun):       -
46 #Requires:      -
47 #Provides:      -
48 #Provides:      group(foo)
49 #Provides:      user(foo)
50 #Obsoletes:     -
51 #Conflicts:     -
52 #BuildArch:     noarch
53 #ExclusiveArch: %{ix86}
54 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55
56 %description
57
58 %description -l pl.UTF-8
59
60 %package subpackage
61 Summary:        -
62 Summary(pl.UTF-8):      -
63 Group:          -
64 #BuildArch:     noarch
65
66 %description subpackage
67
68 %description subpackage -l pl.UTF-8
69
70 %package libs
71 Summary:        -
72 Summary(pl.UTF-8):      -
73 Group:          Libraries
74
75 %description libs
76
77 %description libs -l pl.UTF-8
78
79 %package devel
80 Summary:        Header files for %{name} library
81 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki %{name}
82 Group:          Development/Libraries
83 # if base package contains shared library for which these headers are
84 #Requires:      %{name} = %{version}-%{release}
85 # if -libs package contains shared library for which these headers are
86 #Requires:      %{name}-libs = %{version}-%{release}
87
88 %description devel
89 Header files for %{name} library.
90
91 %description devel -l pl.UTF-8
92 Pliki nagłówkowe biblioteki %{name}.
93
94 %package static
95 Summary:        Static %{name} library
96 Summary(pl.UTF-8):      Statyczna biblioteka %{name}
97 Group:          Development/Libraries
98 Requires:       %{name}-devel = %{version}-%{release}
99
100 %description static
101 Static %{name} library.
102
103 %description static -l pl.UTF-8
104 Statyczna biblioteka %{name}.
105
106 %prep
107 %setup -q
108 #%setup -q -c -T
109 #%setup -q -n %{name}
110 #%setup -q -n %{name}-%{version}.orig -a 1
111 #%patch0 -p1
112
113 # undos the source
114 #find '(' -name '*.php' -o -name '*.inc' ')' -print0 | xargs -0 %{__sed} -i -e 's,\r$,,'
115
116 # remove CVS control files
117 #find -name CVS -print0 | xargs -0 rm -rf
118
119 # you'll need this if you cp -a complete dir in source
120 # cleanup backups after patching
121 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
122
123 %build
124 # if ac/am/* rebuilding is necessary, do it in this order and add
125 # appropriate BuildRequires
126 #%{__intltoolize}
127 #%{__gettextize}
128 #%{__libtoolize}
129 #%{__aclocal}
130 #%{__autoconf}
131 #%{__autoheader}
132 #%{__automake}
133 # if not running libtool or automake, but config.sub is too old:
134 #cp -f /usr/share/automake/config.sub .
135 %configure
136 %{__make}
137
138 #%{__make} \
139 #       CFLAGS="%{rpmcflags}" \
140 #       LDFLAGS="%{rpmldflags}"
141
142 %{?with_tests:%{__make} test}
143
144 %install
145 rm -rf $RPM_BUILD_ROOT
146 # create directories if necessary
147 #install -d $RPM_BUILD_ROOT
148 %if %{with initscript}
149 install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
150 %endif
151 #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
152
153 %{__make} install \
154         DESTDIR=$RPM_BUILD_ROOT
155
156 %clean
157 rm -rf $RPM_BUILD_ROOT
158
159 %pre
160 %groupadd -g xxx %{name}
161 %useradd -u xxx -d /var/lib/%{name} -g %{name} -c "XXX User" %{name}
162
163 %post
164
165 %preun
166
167 %postun
168 if [ "$1" = "0" ]; then
169         %userremove %{name}
170         %groupremove %{name}
171 fi
172
173 %if %{with ldconfig}
174 %post   -p /sbin/ldconfig
175 %postun -p /sbin/ldconfig
176 %endif
177
178 %if %{with initscript}
179 %post
180 /sbin/chkconfig --add %{name}
181 %service %{name} restart
182
183 %preun
184 if [ "$1" = "0" ]; then
185         %service -q %{name} stop
186         /sbin/chkconfig --del %{name}
187 fi
188 %endif
189
190 %if %{with systemd_service}
191 %post
192 %systemd_post %{name}.service
193
194 %preun
195 %systemd_preun %{name}.service
196
197 %postun
198 #%systemd_postun %{name}.service
199 %systemd_postun_with_restart %{name}.service
200 %endif
201
202 %if %{with systemd_user_service}
203 %post
204 %systemd_user_post %{name}.service
205
206 %preun
207 %systemd_user_preun %{name}.service
208 %endif
209
210 %files
211 %defattr(644,root,root,755)
212 %doc AUTHORS CREDITS CHANGES ChangeLog NEWS README THANKS TODO
213
214 %if 0
215 # if _sysconfdir != /etc:
216 #%%dir %{_sysconfdir}
217 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
218 %attr(755,root,root) %{_bindir}/%{name}*
219 %{_datadir}/%{name}
220 %endif
221
222 # initscript and its config
223 %if %{with initscript}
224 %attr(754,root,root) /etc/rc.d/init.d/%{name}
225 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
226 %endif
227
228 %if %{with systemd_service}
229 %{systemdunitdir}/%{name}.service
230 %endif
231
232 %if %{with systemd_user_service}
233 %{systemduserunitdir}/%{name}.service
234 %endif
235
236 #%{_examplesdir}/%{name}-%{version}
237
238 %if %{with subpackage}
239 %files subpackage
240 %defattr(644,root,root,755)
241 #%doc extras/*.gz
242 #%{_datadir}/%{name}-ext
243 %endif
This page took 0.038462 seconds and 2 git commands to generate.