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