summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 77a13832c02e42f6ebf2aa0994bfc40f0891b769 (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
# Maintainer: AlphaJack <alphajack at tuta dot io>
# Contributor K1412 <jonathan@opensides.be>

pkgname="fusiondirectory"
pkgver=1.4.dev
pkgrel=2
_commit="952afba6f3c0adf945937cb2fc21c40fa1d21d36"
pkgdesc="A combination of system administrator and end user web interface, designed to handle LDAP based setups"
url="http://fusiondirectory.org/"
license=("GPL2")
arch=("any")
depends=("gettext"
         "openldap"
         "perl-archive-extract"
         "perl-bytes-random-secure"
         "perl-crypt-cbc"
         #"perl-crypt-rijndael"
         "perl-digest-sha"
         "perl-file-copy-recursive"
         #"perl-extutils-makemaker"
         "perl-ldap"
         #"perl-mime-base64"
         "perl-path-class"
         "perl-term-readkey"
         "perl-xml-twig"
         "php>=7.3"
         "php-cas"
         #"php-filter"
         #"php-fpdf"
         "php-gd"
         "php-imagick"
         "php-imap"
         #"php-json"
         #"php-mbstring"
         #"php-openssl"
         "php-pear"
         #"php-session"
         #"php-simplexml"
         #"php-xml"
         "schema2ldif"
         "smarty3"
         "smarty3-gettext")
optdepends=("fusiondirectory-plugins: core plugins"
            "apache: webserver"
            "nginx: webserver"
            #"php-gettext: internationalized interface support"
            #"php-mhash: ssha encryption support"
            #"php-sha1: ssha encryption support"
            #"php-zlib: snapshot support"
            )
source=(#"https://repos.fusiondirectory.org/sources/$pkgname/$pkgname-$pkgver.tar.gz"
        "https://github.com/fusiondirectory/fusiondirectory/archive/$_commit.tar.gz"
        "http://script.aculo.us/dist/scriptaculous-js-1.9.0.zip"
        "$pkgname.php.ini"
        "$pkgname.tmpfiles")
sha256sums=('4f27b6e1cbb5e78aeaacddfe27ed62155d97897e615a59cd15f08c499c706c09'
            '1fa39bd110d3326a14f920601803813f088d08ecb2cc645aa7075884d998f6f6'
            'a17aebba00b9380fdae13011f3ba0350ec861acaf94eedb6d68c0a04ddb0888c'
            '1732399f263301f212599fd862780422eca5375be1da63acd26506587a348025')
install="$pkgname.install"
options=("!strip")

prepare() {
 cd "$pkgname-$_commit"
 find . -type f -exec sed -i {} \
                          -e "s|/etc/$pkgname|/etc/webapps/$pkgname|g" \
                          -e "s|/etc/ldap|/etc/openldap|g" \
                          -e "s|/var/www/$pkgname|/usr/share/webapps/$pkgname|g" \
                          -e "s|/usr/share/$pkgname|/usr/share/webapps/$pkgname|g" \;
 sed -i "include/variables_common.inc" -e 's|"PEAR_DIR", "/usr/share/php"|"PEAR_DIR", "/usr/share/pear"|'
}

package(){
 cd "$pkgname-$_commit"
 # directories
 install -d -m 755 "$pkgdir/etc/openldap/schema/$pkgname"
 install -d -m 700 "$pkgdir/var/cache/$pkgname"
 install -d -m 755 "$pkgdir/var/cache/$pkgname/template"
 install -d -m 755 "$pkgdir/usr/share/doc/$pkgname/"
 install -d -m 755 "$pkgdir/usr/share/webapps/$pkgname/"
 install -d -m 755 "$pkgdir/usr/share/php/smarty3/plugins/"
 install -d -m 755 "$pkgdir/var/spool/$pkgname/"
 # webapp files and javascript libraries
 _dirs=("html" "ihtml" "include" "locale" "plugins" "setup")
 for _dir in "${_dirs[@]}"; do
  cp -a "$_dir" "$pkgdir/usr/share/webapps/$pkgname/"
 done
 cp -a ../"scriptaculous-js-1.9.0/src/"* "$pkgdir/usr/share/webapps/$pkgname/html/include"
 cp -a ../"scriptaculous-js-1.9.0/lib/prototype.js" "$pkgdir/usr/share/webapps/$pkgname/html/include"
 # executables
 find "contrib/bin/" -type f -exec chmod +x {} \;
 mv "contrib/bin/" "$pkgdir/usr/"
 # configuration file template
 install -D -m 640 "contrib/$pkgname.conf" "$pkgdir/var/cache/$pkgname/template/"
 # php extensions
 install -D -m 644 "../$pkgname.php.ini" "$pkgdir/etc/php/conf.d/$pkgname.ini"
 # smarty3 plugins
 cp "contrib/smarty/plugins/"* "$pkgdir/usr/share/php/smarty3/plugins/"
 rm -r "contrib/smarty"
 # man pages
 gzip -f "contrib/man/$pkgname-setup.1" "contrib/man/$pkgname-insert-schema.1" "contrib/man/$pkgname.conf.5"
 install -D -m 644 "contrib/man/$pkgname-setup.1.gz" "$pkgdir/usr/share/man/man1/$pkgname-setup.1.gz"
 install -D -m 644 "contrib/man/$pkgname-insert-schema.1.gz" "$pkgdir/usr/share/man/man1/$pkgname-insert-schema.1.gz"
 install -D -m 644 "contrib/man/$pkgname.conf.5.gz" "$pkgdir/usr/share/man/man5/$pkgname.conf.5.gz"
 rm -r "contrib/man/"
 # example snippets
 cp -r "contrib" "$pkgdir/usr/share/doc/$pkgname/"
 # directories and file permission
 install -D -m 644 "../$pkgname.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
}