proftpd.spec 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. ##
  2. ## proftpd.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package version
  24. %define V_proftpd 1.3.2rc4
  25. %define V_mod_exec 0.9.6
  26. %define V_mod_otp 0.9.1
  27. %define V_mod_shaper 0.6.4
  28. %define V_mod_sql_sqlite 0.2
  29. %define V_mod_sql_odbc 0.3.2
  30. %define V_mod_time 2.2.1
  31. %define V_mod_vroot 0.8.3
  32. %define V_mod_gss 1.3.1
  33. %define V_mod_sftp 0.9.6
  34. %define V_mod_sftp_sql 0.1
  35. %define V_mod_md5 0.3.3
  36. # package information
  37. Name: proftpd
  38. Summary: Professional FTP Daemon
  39. URL: http://www.proftpd.org/
  40. Vendor: The ProFTPD Project
  41. Packager: OpenPKG Foundation e.V.
  42. Distribution: OpenPKG Community
  43. Class: BASE
  44. Group: FTP
  45. License: GPL
  46. Version: %{V_proftpd}
  47. Release: 20090130
  48. # package options
  49. %option with_ifsession no
  50. %option with_ctrls no
  51. %option with_radius no
  52. %option with_pam no
  53. %option with_mysql no
  54. %option with_pgsql no
  55. %option with_sqlite no
  56. %option with_odbc no
  57. %option with_ldap no
  58. %option with_skey no
  59. %option with_opie no
  60. %option with_kerberos no
  61. %option with_ssl no
  62. %option with_sftp no
  63. %option with_md5 no
  64. # checking option conflicts
  65. %if "%{with_mysql}" == "yes" && "%{with_pgsql}" == "yes"
  66. %{error:build-time options 'with_mysql' and 'with_pgsql' conflict}
  67. %endif
  68. # list of sources
  69. Source0: ftp://ftp.proftpd.org/distrib/source/proftpd-%{V_proftpd}.tar.bz2
  70. Source1: http://www.castaglia.net/proftpd/modules/proftpd-mod-exec-%{V_mod_exec}.tar.gz
  71. Source2: http://www.castaglia.net/proftpd/modules/proftpd-mod-otp-%{V_mod_otp}.tar.gz
  72. Source3: http://www.castaglia.net/proftpd/modules/proftpd-mod-shaper-%{V_mod_shaper}.tar.gz
  73. Source4: http://www.castaglia.net/proftpd/modules/proftpd-mod-sql-sqlite-%{V_mod_sql_sqlite}.tar.gz
  74. Source5: http://www.castaglia.net/proftpd/modules/proftpd-mod-sql-odbc-%{V_mod_sql_odbc}.tar.gz
  75. Source6: http://www.castaglia.net/proftpd/modules/proftpd-mod-time-%{V_mod_time}.tar.gz
  76. Source7: http://www.castaglia.net/proftpd/modules/proftpd-mod-vroot-%{V_mod_vroot}.tar.gz
  77. Source8: http://switch.dl.sourceforge.net/gssmod/mod_gss-%{V_mod_gss}.tar.gz
  78. Source9: http://www.castaglia.net/proftpd/modules/proftpd-mod-sftp-%{V_mod_sftp}.tar.gz
  79. Source10: http://www.castaglia.net/proftpd/modules/proftpd-mod-sftp-sql-%{V_mod_sftp_sql}.tar.gz
  80. Source11: http://www.castaglia.net/proftpd/modules/proftpd-mod-md5-%{V_mod_md5}.tar.gz
  81. Source12: proftpd.conf
  82. Source13: proftpd.msg.goaway
  83. Source14: proftpd.msg.login
  84. Source15: rc.proftpd
  85. Patch0: proftpd.patch
  86. # build information
  87. Prefix: %{l_prefix}
  88. BuildRoot: %{l_buildroot}
  89. BuildPreReq: OpenPKG, openpkg >= 20060823, make
  90. PreReq: OpenPKG, openpkg >= 20060823
  91. BuildPreReq: ncurses, getopt
  92. PreReq: ncurses, getopt
  93. %if "%{with_mysql}" == "yes"
  94. BuildPreReq: mysql
  95. PreReq: mysql
  96. %endif
  97. %if "%{with_pam}" == "yes"
  98. BuildPreReq: PAM
  99. PreReq: PAM
  100. %endif
  101. %if "%{with_pgsql}" == "yes"
  102. BuildPreReq: postgresql, openssl
  103. PreReq: postgresql, openssl
  104. %endif
  105. %if "%{with_sqlite}" == "yes"
  106. BuildPreReq: sqlite
  107. PreReq: sqlite
  108. %endif
  109. %if "%{with_odbc}" == "yes"
  110. BuildPreReq: ODBC
  111. PreReq: ODBC
  112. %endif
  113. %if "%{with_ldap}" == "yes"
  114. BuildPreReq: openldap, openssl
  115. PreReq: openldap, openssl
  116. %endif
  117. %if "%{with_skey}" == "yes"
  118. BuildPreReq: skey
  119. PreReq: skey
  120. %endif
  121. %if "%{with_opie}" == "yes"
  122. BuildPreReq: opie
  123. PreReq: opie
  124. %endif
  125. %if "%{with_kerberos}" == "yes"
  126. BuildPreReq: KERBEROS
  127. PreReq: KERBEROS
  128. %endif
  129. %if "%{with_ssl}" == "yes" || "%{with_sftp}" == "yes"
  130. BuildPreReq: openssl
  131. PreReq: openssl
  132. %endif
  133. AutoReq: no
  134. AutoReqProv: no
  135. %description
  136. ProFTPD grew out of the desire to have a secure and configurable
  137. FTP server, and out of a significant admiration of the Apache web
  138. server. There are currently a very limited number of FTP servers
  139. running on unix (or unix-like) hosts. The most commonly used server
  140. is probably wu-ftpd. While wu-ftpd provides excellent performance
  141. and is generally a good product, it lacks numerous features found
  142. in newer Win32 FTP servers, and has a poor security history. Many
  143. people, including the developers who work on ProFTPD have spent a
  144. great deal of time fixing bugs and hacking features into wu-ftpd.
  145. Unfortunately, it quickly became clear that a complete redesign was
  146. necessary in order to implement the configurability and features
  147. desired. ProFTPD is not a hack based on any other server, it's an
  148. independent source tree from the ground up. Click here for a small
  149. list of some of the sites ProFTPD powers -- many of them handling
  150. large volumes of traffic on a daily basis.
  151. %track
  152. prog proftpd = {
  153. version = %{V_proftpd}
  154. url = ftp://ftp.proftpd.org/distrib/source/
  155. regex = proftpd-(\d+\.\d+\.\d+(?:rc\d+|[a-z]?))\.tar\.bz2
  156. }
  157. prog proftpd:mod_exec = {
  158. version = %{V_mod_exec}
  159. url = http://www.castaglia.net/proftpd/
  160. regex = proftpd-mod-exec-(__VER__)\.tar\.gz
  161. }
  162. prog proftpd:mod_shaper = {
  163. version = %{V_mod_shaper}
  164. url = http://www.castaglia.net/proftpd/
  165. regex = proftpd-mod-shaper-(__VER__)\.tar\.gz
  166. }
  167. prog proftpd:mod_sql_sqlite = {
  168. version = %{V_mod_sql_sqlite}
  169. url = http://www.castaglia.net/proftpd/
  170. regex = proftpd-mod-sql-sqlite-(__VER__)\.tar\.gz
  171. }
  172. prog proftpd:mod_sql_odbc = {
  173. version = %{V_mod_sql_odbc}
  174. url = http://www.castaglia.net/proftpd/
  175. regex = proftpd-mod-sql-odbc-(__VER__)\.tar\.gz
  176. }
  177. prog proftpd:mod_time = {
  178. version = %{V_mod_time}
  179. url = http://www.castaglia.net/proftpd/
  180. regex = proftpd-mod-time-(__VER__)\.tar\.gz
  181. }
  182. prog proftpd:mod_vroot = {
  183. version = %{V_mod_vroot}
  184. url = http://www.castaglia.net/proftpd/
  185. regex = proftpd-mod-vroot-(__VER__)\.tar\.gz
  186. }
  187. prog proftpd:mod_gss = {
  188. version = %{V_mod_gss}
  189. url = http://prdownloads.sourceforge.net/gssmod/
  190. regex = mod_gss-(__VER__)\.tar\.gz
  191. }
  192. prog proftpd:mod_sftp = {
  193. version = %{V_mod_sftp}
  194. url = http://www.castaglia.net/proftpd/
  195. regex = proftpd-mod-sftp-(__VER__)\.tar\.gz
  196. }
  197. prog proftpd:mod_sftp_sql = {
  198. version = %{V_mod_sftp_sql}
  199. url = http://www.castaglia.net/proftpd/
  200. regex = proftpd-mod-sftp-sql-(__VER__)\.tar\.gz
  201. }
  202. prog proftpd:mod_md5 = {
  203. version = %{V_mod_md5}
  204. url = http://www.castaglia.net/proftpd/
  205. regex = proftpd-mod-md5-(__VER__)\.tar\.gz
  206. }
  207. %prep
  208. %setup -q
  209. %setup -q -D -T -a 1
  210. %setup -q -D -T -a 2
  211. %setup -q -D -T -a 3
  212. %setup -q -D -T -a 4
  213. %setup -q -D -T -a 5
  214. %setup -q -D -T -a 6
  215. %setup -q -D -T -a 7
  216. %setup -q -D -T -a 8
  217. %setup -q -D -T -a 9
  218. %setup -q -D -T -a 10
  219. %setup -q -D -T -a 11
  220. %patch -p0
  221. %{l_shtool} subst \
  222. -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \
  223. configure
  224. # utils require to link with getopt
  225. %{l_shtool} subst \
  226. -e 's;\(\$(BUILD_FTPCOUNT_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \
  227. -e 's;\(\$(BUILD_FTPSHUT_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \
  228. -e 's;\(\$(BUILD_FTPTOP_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \
  229. -e 's;\(\$(BUILD_FTPWHO_OBJS).*\);\1 %{l_ldflags} -lgetopt;g' \
  230. Makefile.in
  231. %if "%{with_mysql}" == "yes"
  232. libs=`mysql_config --libs`
  233. # libmysqlclient may require more libraries
  234. %{l_shtool} subst \
  235. -e "s;\(-lmysqlclient\);$libs;g" \
  236. contrib/mod_sql_mysql.c
  237. %endif
  238. # libpq also requires openssl
  239. # postgresql also doesn't provide its own include subdirectory
  240. %{l_shtool} subst \
  241. -e 's;\(-lpq\);\1 -lssl -lcrypto;g' \
  242. -e 's;^\(#include <\)pgsql/\(libpq-fe.h>.*\)$;\1postgresql/\2;' \
  243. contrib/mod_sql_postgres.c
  244. # libldap also requires openssl
  245. %{l_shtool} subst \
  246. -e 's;\(-llber\);\1 -lssl -lcrypto;g' \
  247. contrib/mod_ldap.c
  248. # prepare mod_otp module
  249. %if "%{with_skey}" == "yes" || "%{with_opie}" == "yes"
  250. ( cd mod_otp
  251. CC="%{l_cc}" \
  252. CFLAGS="%{l_cflags -O}" \
  253. CPPFLAGS="%{l_cppflags}" \
  254. LDFLAGS="%{l_ldflags}" \
  255. ./configure \
  256. %if "%{with_skey}" == "yes"
  257. --with-skey \
  258. %endif
  259. %if "%{with_opie}" == "yes"
  260. --with-opie \
  261. %endif
  262. %{l_nil}
  263. cp mod_otp.[ch] ../contrib/
  264. ) || exit $?
  265. %endif
  266. # prepare mod_sql_odbc module
  267. %if "%{with_odbc}" == "yes"
  268. ( cd mod_sql_odbc
  269. if [ -f %{l_prefix}/etc/unixodbc/odbc.ini ]; then
  270. ./configure --enable-unixodbc
  271. else
  272. ./configure --enable-iodbc
  273. fi
  274. ) || exit $?
  275. %endif
  276. # prepare optional add-on modules
  277. cp mod_exec/mod_exec.c contrib/
  278. cp mod_sql_sqlite/mod_sql_sqlite.c contrib/
  279. cp mod_sql_odbc/mod_sql_odbc.[ch] contrib/
  280. cp mod_time/mod_time.c contrib/
  281. cp mod_vroot/mod_vroot.c contrib/
  282. %if "%{with_ctrls}" == "yes"
  283. cp mod_shaper/mod_shaper.c contrib/
  284. %endif
  285. %if "%{with_sftp}" == "yes"
  286. cp -r mod_sftp contrib/
  287. %if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes" || "%{with_odbc}" == "yes"
  288. cp mod_sftp_sql/mod_sftp_sql.c contrib/
  289. %endif
  290. %endif
  291. %if "%{with_md5}" == "yes"
  292. cp mod_md5/mod_md5.c contrib/
  293. %endif
  294. # prepare mod_gss module
  295. %if "%{with_kerberos}" == "yes"
  296. ( cd mod_gss-*
  297. CC="%{l_cc}" \
  298. CFLAGS="%{l_cflags -O}" \
  299. CPPFLAGS="%{l_cppflags}" \
  300. LDFLAGS="%{l_ldflags}" \
  301. ./configure \
  302. --prefix=%{l_prefix} \
  303. `if [ -d %{l_prefix}/include/heimdal ]; then \
  304. echo "--enable-heimdal"; \
  305. else \
  306. echo "--enable-mit"; \
  307. fi`
  308. cp mod_gss.h ../include/
  309. cp mod_gss.c ../contrib/
  310. ) || exit $?
  311. %endif
  312. %build
  313. # make non-standard "rundir" the same as standard "sysconfdir"
  314. %{l_shtool} subst \
  315. -e 's;^\(rundir=@localstatedir@\)/proftpd;\1;' \
  316. Make.rules.in
  317. %{l_shtool} subst \
  318. -e 's;^\(#define PR_RUN_DIR "`eval echo "${localstatedir}\)/proftpd;\1;' \
  319. configure
  320. # write shutdown message file to OpenPKG instance, not outside
  321. %{l_shtool} subst \
  322. -e 's;\(#define PR_SHUTMSG_PATH.*"\)\(/etc/\)\(shutmsg\)";\1%{l_prefix}\2proftpd/\3";' \
  323. include/default_paths.h
  324. # configure the ProFTPd source tree
  325. MOD="mod_ratio:mod_readme:mod_exec:mod_time:mod_vroot"
  326. MOD_INC="%{l_prefix}/include"
  327. MOD_LIB="%{l_prefix}/lib"
  328. %if "%{with_ifsession}" == "yes"
  329. MOD="$MOD:mod_ifsession"
  330. %endif
  331. %if "%{with_ctrls}" == "yes"
  332. MOD="$MOD:mod_shaper"
  333. MOD="$MOD:mod_ctrls_admin"
  334. %endif
  335. %if "%{with_radius}" == "yes"
  336. MOD="$MOD:mod_radius"
  337. %endif
  338. %if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes" || "%{with_odbc}" == "yes"
  339. MOD="$MOD:mod_sql"
  340. %if "%{with_mysql}" == "yes"
  341. MOD="$MOD:mod_sql_mysql"
  342. MOD_INC=":%{l_prefix}/include/mysql"
  343. %endif
  344. %if "%{with_pgsql}" == "yes"
  345. MOD="$MOD:mod_sql_postgres"
  346. MOD_INC=":%{l_prefix}/include/postgresql"
  347. %endif
  348. %if "%{with_sqlite}" == "yes"
  349. MOD="$MOD:mod_sql_sqlite"
  350. %endif
  351. %if "%{with_odbc}" == "yes"
  352. MOD="$MOD:mod_sql_odbc"
  353. %endif
  354. %endif
  355. %if "%{with_ldap}" == "yes"
  356. MOD="$MOD:mod_ldap"
  357. %endif
  358. %if "%{with_skey}" == "yes" || "%{with_opie}" == "yes"
  359. MOD="$MOD:mod_otp"
  360. %endif
  361. %if "%{with_kerberos}" == "yes"
  362. MOD="$MOD:mod_gss"
  363. %endif
  364. %if "%{with_ssl}" == "yes"
  365. MOD="$MOD:mod_tls"
  366. %endif
  367. %if "%{with_sftp}" == "yes"
  368. MOD="$MOD:mod_sftp"
  369. %if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes" || "%{with_odbc}" == "yes"
  370. MOD="$MOD:mod_sftp_sql"
  371. %endif
  372. %endif
  373. %if "%{with_md5}" == "yes"
  374. MOD="$MOD:mod_md5"
  375. %endif
  376. export CC="%{l_cc}"
  377. export CFLAGS="%{l_cflags -O}"
  378. export CPPFLAGS="%{l_cppflags ncurses}"
  379. export LDFLAGS="%{l_ldflags}"
  380. export LIBS="-lgetopt"
  381. %if "%{with_pam}" == "yes"
  382. CPPFLAGS="$CPPFLAGS -I`%{l_rc} --query pam_incdir`"
  383. LDFLAGS="$LDFLAGS -L`%{l_rc} --query pam_libdir`"
  384. %endif
  385. %if "%{with_kerberos}" == "yes"
  386. CPPFLAGS="$CPPFLAGS `krb5-config --cflags gssapi`"
  387. LIBS="$LIBS `krb5-config --libs gssapi`"
  388. %endif
  389. ./configure \
  390. --prefix=%{l_prefix} \
  391. --sysconfdir=%{l_prefix}/etc/proftpd \
  392. --localstatedir=%{l_prefix}/var/proftpd \
  393. --with-modules="$MOD" \
  394. --with-includes="$MOD_INC" \
  395. --with-libraries="$MOD_LIB" \
  396. --enable-buffer-size=1024 \
  397. %if "%{with_ctrls}" == "yes"
  398. --enable-ctrls \
  399. %endif
  400. --without-getopt \
  401. %if "%{with_pam}" == "yes"
  402. --enable-auth-pam
  403. %else
  404. --disable-auth-pam
  405. %endif
  406. # build ProFTPd programs
  407. %{l_make} %{l_mflags}
  408. %install
  409. rm -rf $RPM_BUILD_ROOT
  410. # make sure the "install" procedure does not try
  411. # to perform explicit ownership assignments
  412. %{l_shtool} subst -v \
  413. -e 's;-o $(INSTALL_USER) -g $(INSTALL_GROUP);;g' \
  414. -e 's;chown;true;g' \
  415. Makefile Make.rules
  416. # perform the "install" procedure while redirecting
  417. # it to the temporarily install area
  418. %{l_make} %{l_mflags} \
  419. install-proftpd install-utils install-man \
  420. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  421. bindir=$RPM_BUILD_ROOT%{l_prefix}/bin \
  422. sbindir=$RPM_BUILD_ROOT%{l_prefix}/sbin \
  423. sysconfdir=$RPM_BUILD_ROOT%{l_prefix}/etc/proftpd \
  424. localstatedir=$RPM_BUILD_ROOT%{l_prefix}/var/proftpd \
  425. rundir=$RPM_BUILD_ROOT%{l_prefix}/var/proftpd
  426. # strip installation
  427. rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/in.proftpd
  428. # install more stuff manually
  429. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/share/proftpd
  430. %{l_shtool} install -c -m 644 doc/faq.html \
  431. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/faq.html
  432. %{l_shtool} install -c -m 644 doc/Configuration.html \
  433. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/cfg.html
  434. # extended installation with own stuff
  435. l_pam="#"
  436. %if "%{with_pam}" == "yes"
  437. l_pam=""
  438. %endif
  439. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  440. -e "s;@l_pam@;${l_pam};g" \
  441. %{SOURCE proftpd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/
  442. %{l_shtool} install -c -m 644 \
  443. %{SOURCE proftpd.msg.goaway} \
  444. %{SOURCE proftpd.msg.login} \
  445. $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/
  446. %{l_shtool} install -c -m 644 \
  447. %{SOURCE proftpd.msg.login} \
  448. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.login
  449. %{l_shtool} install -c -m 644 \
  450. %{SOURCE proftpd.msg.goaway} \
  451. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.goaway
  452. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  453. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  454. %{SOURCE rc.proftpd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  455. # determine the package ingredients
  456. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  457. %{l_files_std} \
  458. '%config %attr(0600,%{l_susr},%{l_sgrp}) %{l_prefix}/etc/proftpd/proftpd.conf' \
  459. '%config %{l_prefix}/etc/proftpd/proftpd.msg.*'
  460. %files -f files
  461. %clean
  462. rm -rf $RPM_BUILD_ROOT
  463. %post
  464. %if "%{with_pam}" == "yes"
  465. # add PAM configuration entry
  466. if [ $1 -eq 1 ]; then
  467. $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=proftpd
  468. fi
  469. %endif
  470. # after upgrade, restart service
  471. [ $1 -eq 2 ] || exit 0
  472. eval `%{l_rc} proftpd status 2>/dev/null`
  473. [ ".$proftpd_active" = .yes ] && %{l_rc} proftpd restart
  474. exit 0
  475. %preun
  476. # before erase, stop service and remove log files
  477. [ $1 -eq 0 ] || exit 0
  478. %{l_rc} proftpd stop 2>/dev/null
  479. rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.log* >/dev/null 2>&1 || true
  480. rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.pid >/dev/null 2>&1 || true
  481. %if "%{with_pam}" == "yes"
  482. # remove PAM configuration entry
  483. $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=proftpd
  484. %endif
  485. exit 0