webmin.spec 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. ##
  2. ## webmin.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2009 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 information
  24. Name: webmin
  25. Summary: Web Interface for Unix System Administration
  26. URL: http://www.webmin.com/
  27. Vendor: Jamie Cameron
  28. Packager: OpenPKG Foundation e.V.
  29. Distribution: OpenPKG Community
  30. Class: EVAL
  31. Group: Web
  32. License: BSD-style
  33. Version: 1.480
  34. Release: 20090703
  35. # list of sources
  36. Source0: http://switch.dl.sourceforge.net/sourceforge/webadmin/webmin-%{version}.tar.gz
  37. Source1: rc.webmin
  38. # build information
  39. Prefix: %{l_prefix}
  40. BuildRoot: %{l_buildroot}
  41. BuildPreReq: OpenPKG, openpkg >= 20060823, perl
  42. PreReq: OpenPKG, openpkg >= 20060823, perl
  43. AutoReq: no
  44. AutoReqProv: no
  45. %description
  46. Webmin is a web-based interface for system administration for Unix.
  47. Using any browser that supports tables and forms (and Java for the
  48. File Manager module), you can manipulate user accounts, Apache, DNS,
  49. file sharing and so on. Webmin consists of a simple web server, and
  50. several of CGI programs which directly update system files. The web
  51. server and all CGI programs are written in Perl using standard modules.
  52. %track
  53. prog webmin = {
  54. version = %{version}
  55. url = http://sourceforge.net/projects/webadmin/files/
  56. regex = webmin-(__VER__)\.tar\.gz
  57. }
  58. %prep
  59. %setup -q
  60. %{l_shtool} subst \
  61. -e 's;^[^a-zA-Z0-9]*chown.*$;true;g' \
  62. -e 's;^[^a-zA-Z0-9]*chgrp.*$;true;g' \
  63. -e 's;^[^a-zA-Z0-9]*chmod.*$;true;g' \
  64. -e 's;^.*\(\$perl \-e.*\$port\);# Do not check the server port: \1;g' \
  65. -e 's/\(.*\)echo "ERROR: The Webmin install script must be run as root.*/\1true; fi; if false; then/g' \
  66. setup.sh
  67. for badfname in `find . -name '*\\**' -print | %{l_shtool} subst -e 's;\\*;\\\\\*;g;'`
  68. do
  69. gudfname=`echo ${badfname} | %{l_shtool} subst -e 's;\\\\\*;=;'`
  70. eval mv ${badfname} ${gudfname}
  71. done
  72. %build
  73. %install
  74. case "%{l_platform -t}" in
  75. *-sunos* ) os="1" ;;
  76. *-freebsd* ) os="42" ;;
  77. *-linux* ) os="6" ;;
  78. * ) echo "platform %{l_platform -t} not supported" 2>&1; exit 1 ;;
  79. esac
  80. rm -rf $RPM_BUILD_ROOT
  81. %{l_shtool} mkdir -f -p -m 755 \
  82. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  83. $RPM_BUILD_ROOT%{l_prefix}/etc/webmin \
  84. $RPM_BUILD_ROOT%{l_prefix}/lib/webmin \
  85. $RPM_BUILD_ROOT%{l_prefix}/var/webmin
  86. install_dir=$RPM_BUILD_ROOT%{l_prefix}/lib/webmin
  87. config_dir=$RPM_BUILD_ROOT%{l_prefix}/etc/webmin
  88. var_dir=$RPM_BUILD_ROOT%{l_prefix}/var/webmin
  89. upgrading=0
  90. perl=%{l_prefix}/bin/perl
  91. os_type=$os
  92. port=8080
  93. login='admin'
  94. password='admin'
  95. password2='admin'
  96. ssl=1
  97. atboot=0
  98. nostart=1
  99. nochown=1
  100. export config_dir var_dir upgrading os_type perl port \
  101. login password password2 ssl atboot nostart nochown
  102. ./setup.sh $install_dir 2>&1 >/dev/null
  103. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/webmin/uninstall.sh
  104. %{l_shtool} subst \
  105. -e "s;$RPM_BUILD_ROOT;;g" \
  106. $RPM_BUILD_ROOT%{l_prefix}/etc/webmin/* \
  107. >/dev/null 2>&1
  108. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  109. %{SOURCE rc.webmin} \
  110. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  111. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  112. %{l_files_std} \
  113. '%config %{l_prefix}/etc/webmin/*/config' \
  114. '%config %{l_prefix}/etc/webmin/*/admin.acl' \
  115. '%config %{l_prefix}/etc/webmin/config' \
  116. '%config %{l_prefix}/etc/webmin/miniserv.conf' \
  117. '%config %{l_prefix}/etc/webmin/miniserv.pem' \
  118. '%config %{l_prefix}/etc/webmin/miniserv.users' \
  119. '%config %{l_prefix}/etc/webmin/webmin.acl'
  120. %files -f files
  121. %clean
  122. rm -rf $RPM_BUILD_ROOT
  123. %post
  124. # after upgrade, restart service
  125. [ $1 -eq 2 ] || exit 0
  126. eval `%{l_rc} webmin status 2>/dev/null`
  127. [ ".$webmin_active" = .yes ] && %{l_rc} webmin restart
  128. exit 0
  129. %preun
  130. # before erase, stop service and remove log files
  131. [ $1 -eq 0 ] || exit 0
  132. %{l_rc} webmin stop 2>/dev/null
  133. rm -f $RPM_INSTALL_PREFIX/var/webmin/*.log >/dev/null 2>&1 || true
  134. exit 0