summaryrefslogtreecommitdiff
path: root/extra/usermin/PKGBUILD
blob: 9bbc7ed69a578d602b338693fd92af35b701a4fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# $Id: PKGBUILD 177553 2013-02-07 05:50:05Z eric $
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
pkgname=usermin
pkgver=1.530
pkgrel=1
pkgdesc="a web interface that can be used to easily perform tasks like reading mail, setting up SSH or configuring mail forwarding"
arch=(i686 x86_64 'mips64el')
license=('custom:usermin')
url="http://www.webmin.com/"
depends=('perl' 'webmin')
makedepends=('perl-net-ssleay')
backup=('etc/usermin/miniserv.conf' 'etc/usermin/miniserv.users' 'etc/usermin/config' 'etc/usermin/usermin.cats' \
'etc/usermin/at/config' \
'etc/usermin/man/config' \
'etc/usermin/ssh/config' \
'etc/usermin/chfn/config' \
'etc/usermin/cron/config' \
'etc/usermin/file/config' \
'etc/usermin/plan/config' \
'etc/usermin/proc/config' \
'etc/usermin/spam/config' \
'etc/usermin/htaccess/config' \
'etc/usermin/cshrc/config' \
'etc/usermin/gnupg/config' \
'etc/usermin/mysql/config' \
'etc/usermin/quota/config' \
'etc/usermin/shell/config' \
'etc/usermin/theme/config' \
'etc/usermin/mailbox/config' \
'etc/usermin/schedule/config' \
'etc/usermin/config' \
'etc/usermin/commands/config' \
'etc/usermin/htaccess-htpasswd/config' \
'etc/usermin/forward/config' \
'etc/usermin/telnet/config' \
'etc/usermin/tunnel/config' \
'etc/usermin/updown/config' \
'etc/usermin/procmail/config' \
'etc/usermin/fetchmail/config' \
'etc/usermin/changepass/config' \
'etc/usermin/language/config' \
'etc/usermin/postgresql/config' \
'etc/usermin/usermount/config' \
)
install=usermin.install
source=(http://downloads.sourceforge.net/sourceforge/webadmin/$pkgname-$pkgver.tar.gz 
	usermin.rc 
	usermin.service
	ftp://ftp.archlinux.org/other/usermin/usermin-config.tar.bz2) 

package() {
  cd "$srcdir"/$pkgname-$pkgver
    
  # remove modules we do not support

  #remove config files from other distros
  rm -f $(find . ! -name 'config-generic-linux' ! -name 'config-\*-linux' ! -name 'config-lib.pl' -name 'config-*')
  
  # remove caldera theme
  rm -rf caldera

  # remove init-scripts from other distros
  rm usermin-init
  rm usermin-daemon

  # setting perl path
  (find . -name '*.cgi' ; find . -name '*.pl') | perl perlpath.pl /usr/bin/perl -
  
  # create dirs
  mkdir -p "$pkgdir"/opt/usermin
  mkdir -p "$pkgdir"/var/log/usermin
  mkdir -p "$pkgdir"/etc/usermin
  
  # install pam stuff
  install -D -m 644 usermin-pam "$pkgdir"/etc/pam.d/usermin
  
  # remove other distros and add only Archlinux don't change next line else it will not work!
  rm os_list.txt
  echo 'Archlinux			Any version	generic-linux	*	-d "/etc/pacman.d"' >> os_list.txt
  
  # copy stuff to right dirs
  cd "$srcdir"/$pkgname-$pkgver
  cp -rp * "$pkgdir"/opt/usermin
  cd "$srcdir"/usermin-config
  cp -rfp * "$pkgdir"/opt/usermin

  # define parameters for setup.sh
  config_dir="$pkgdir"/etc/usermin
  var_dir="$pkgdir"/var/log/usermin
  perl=/usr/bin/perl
  autoos=1
  port=20000
  login=root
  crypt="XXX"
  ssl=1
  atboot=0
  nostart=1
  nochown=1
  autothird=1
  nouninstall=1
  noperlpath=1
  atbootyn=n
  tempdir="$pkgdir"/tmp
  export config_dir var_dir perl autoos port tempdir ssl nochown autothird nouninstall nostart noperlpath atbootyn login crypt
  
  # Fix setup.sh
  sed -i -e 's:read atbootyn::g' -e 's:exit 13::g' "$pkgdir"/opt/usermin/setup.sh
  "$pkgdir"/opt/usermin/setup.sh
  
  # Fixup the config files to use their real locations
  sed -i 's:^pidfile=.*$:pidfile=/var/run/usermin.pid:' "$pkgdir"/etc/usermin/miniserv.conf
  find "$pkgdir"/etc/usermin -type f -exec sed -i "s:$pkgdir::g" {} \; 
  
  # make it only accessible by localhost
  echo 'allow=127.0.0.1' >> "$pkgdir"/etc/usermin/miniserv.conf
  
  # enable user and password login
  sed -i -e '/localauth/d' "$pkgdir"/etc/usermin/miniserv.conf

  #install systemd service file
  install -D -m 644 "$srcdir"/usermin.service "$pkgdir"/usr/lib/systemd/system/usermin.service
 
 #install rc file
  install -D -m 755 "$srcdir"/usermin.rc "$pkgdir"/etc/rc.d/usermin

  # delete temp dir
  rm -r "$pkgdir"/tmp
  #install license
  install -m 644 -D "$srcdir"/$pkgname-$pkgver/LICENCE "$pkgdir"/usr/share/licenses/usermin/LICENCE
}
md5sums=('5a00ec2d294935676efc12f607446fb4'
         'cfef4490cd1ef9517c0b39a7bd75c968'
         'a5bd5e5ee779f8a3cf3d776ca77ee36e'
         'ec37a79f948f778224550930d2a7ca07')