summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2e7683b81fcc47b8e9cc39a1c2cef9aac5a48013 (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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# Maintainer: Brian Bidulock <bidulock@openss7.org>
pkgbase=openss7-git
_pkgbase=openss7
pkgname=('openss7-git' 'openss7-modules-git' 'openss7-modules-lts-git' 'openss7-java-git')
pkgver=1.1.8.69.gc04a4acaa
pkgrel=1
pkgdesc="OpenSS7 Fast-STREAMS and Protocol Suites"
arch=('x86_64' 'i686')
url="http://www.openss7.org"
license=('AGPL3')
depends=('binutils')
makedepends=('doxygen' 'gcc-gcj' 'gcc-libs' 'ghostscript' 'gjdoc' 'glibc'
	     'gnupg' 'gnuplot' 'imagemagick' 'latex2html' 'linux'
	     'linux-headers' 'linux-lts' 'linux-lts-headers' 'lsof'
	     'net-snmp' 'openssl' 'swig' 'systemd' 'tcl' 'texlive-bin'
	     'texlive-core' 'transfig' 'gawk' 'java-environment' 'lm_sensors'
             'popt' 'zip' 'git')
conflicts=("$_pkgbase" 'strigi')
options=('!emptydirs' '!distcc' '!makeflags')
#source=("$pkgbase::git+file:///u2/git/monavacon.git")
source=("$pkgbase::git+https://github.com/openss7/openss7.git")
md5sums=('SKIP')

pkgver() {
  cd $pkgbase
  git describe --long --tags|sed -e 's,^openss7-,,;s,\.2[0-9]*-,-,;s,[-_],.,g'
}

prepare() {
  cd $pkgbase
  echo "$pkgver"|awk 'BEGIN{FS="."}{print$4"."$5}'>.pkgpatchlevel
  [ -x configure ] || autoreconf -fi

  cd "$srcdir"
  cp -au openss7-git openss7-modules-git
  cp -au openss7-git openss7-modules-lts-git
}

build() {
  cd "$srcdir/openss7-git"

  _csite_file=../$CARCH-config.site
  _mpost_file=../$CARCH-modpost.cache
  _cache_file=../$CARCH-config.cache

  _kvr="$(pacman -Qi linux-lts|awk '/^Version/{print$3}')-lts"

  ./configure \
      CPPFLAGS="$CPPFLAGS" \
      CFLAGS="$CFLAGS" \
      CXXFLAGS="$CXXFLAGS" \
      LDFLAGS="$LDFLAGS" \
      DEBUG_CFLAGS="$DEBUG_CFLAGS" \
      DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS" \
      syslibdir=/usr/lib \
      sysbindir=/usr/bin \
      syssbindir=/usr/bin \
      CONFIG_SITE=${_csite_file} \
      MODPOST_CACHE=${_mpost_file} \
      --cache-file=${_cache_file} \
      --libdir=/usr/lib \
      --bindir=/usr/bin \
      --sbindir=/usr/bin \
      --libexecdir=/usr/lib \
      --docdir=/usr/share/doc/$_pkgbase \
      --disable-maintainer-mode \
      --disable-sysvinit \
      --disable-k-abi-support \
      --disable-k-weak-symbols \
      --enable-k-weak-modules \
      --disable-specfs-lock \
      --with-k-release=$_kvr \
      --with-k-optimize=speed \
      --with-optimize=speed \
      --with-gnu-ld \
      --disable-modules
  make

  cd "$srcdir/openss7-modules-lts-git"

  _kvr="$(pacman -Qi linux-lts|awk '/^Version/{print$3}')-lts"

  _csite_file=../$CARCH-config.site
  _mpost_file=../$CARCH-$_kvr-modpost.cache
  _cache_file=../$CARCH-$_kvr-config.cache

  ./configure \
      CPPFLAGS="$CPPFLAGS" \
      CFLAGS="$CFLAGS" \
      CXXFLAGS="$CXXFLAGS" \
      LDFLAGS="$LDFLAGS" \
      DEBUG_CFLAGS="$DEBUG_CFLAGS" \
      DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS" \
      syslibdir=/usr/lib \
      sysbindir=/usr/bin \
      syssbindir=/usr/bin \
      CONFIG_SITE=${_csite_file} \
      MODPOST_CACHE=${_mpost_file} \
      --cache-file=${_cache_file} \
      --libdir=/usr/lib \
      --bindir=/usr/bin \
      --sbindir=/usr/bin \
      --libexecdir=/usr/lib \
      --docdir=/usr/share/doc/$_pkgbase \
      --disable-maintainer-mode \
      --disable-static \
      --disable-sysvinit \
      --disable-k-abi-support \
      --disable-k-weak-symbols \
      --enable-k-weak-modules \
      --disable-specfs-lock \
      --with-k-release=$_kvr \
      --with-k-optimize=speed \
      --with-optimize=speed \
      --with-gnu-ld \
      --disable-docs \
      --disable-tools
  make

  cd "$srcdir/openss7-modules-git"

  _kvr="$(pacman -Qi linux|awk '/^Version/{print$3}')-ARCH"

  _csite_file=../$CARCH-config.site
  _mpost_file=../$CARCH-$_kvr-modpost.cache
  _cache_file=../$CARCH-$_kvr-config.cache

  ./configure \
      CPPFLAGS="$CPPFLAGS" \
      CFLAGS="$CFLAGS" \
      CXXFLAGS="$CXXFLAGS" \
      LDFLAGS="$LDFLAGS" \
      DEBUG_CFLAGS="$DEBUG_CFLAGS" \
      DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS" \
      syslibdir=/usr/lib \
      sysbindir=/usr/bin \
      syssbindir=/usr/bin \
      CONFIG_SITE=${_csite_file} \
      MODPOST_CACHE=${_mpost_file} \
      --cache-file=${_cache_file} \
      --libdir=/usr/lib \
      --bindir=/usr/bin \
      --sbindir=/usr/bin \
      --libexecdir=/usr/lib \
      --docdir=/usr/share/doc/$_pkgbase \
      --disable-maintainer-mode \
      --disable-static \
      --disable-sysvinit \
      --disable-k-abi-support \
      --disable-k-weak-symbols \
      --enable-k-weak-modules \
      --disable-specfs-lock \
      --with-k-release=$_kvr \
      --with-k-optimize=speed \
      --with-optimize=speed \
      --with-gnu-ld \
      --disable-docs \
      --disable-tools
  make
}

package_openss7-git() {
  pkgdesc="OpenSS7 Fast-STREAMS and Protocol Suites"
  backup=('etc/snmp/snmp.d/01openss7'
          'etc/sock2path.d/openss7')
  provides=("$_pkgbase")
  conflicts=("$_pkgbase" 'strigi' 'lksctp-tools' 'strace')
  depends=('net-snmp' 'gawk' 'lm_sensors' 'popt')
  optdepends=('perl-tk: for graphical utilities'
              'gtkdialog: for graphical utilities')
  options=('!emptydirs' 'strip' '!zipman')
  install="openss7-git.install"

  cd "$srcdir"/openss7-git
  make DESTDIR="$pkgdir" install-strip

  rm -fr "$srcdir/_java/usr/lib"
  mkdir -p "$srcdir/_java/usr/lib"
  mv -fv "$pkgdir/usr/lib/java"      "$srcdir/_java/usr/lib"
  mv -fv "$pkgdir/usr/lib/gcj"       "$srcdir/_java/usr/lib"
  rm -fr "$srcdir/_java/usr/share"
  mkdir -p "$srcdir/_java/usr/share"
  mv -fv "$pkgdir/usr/share/java"    "$srcdir/_java/usr/share"
  mv -fv "$pkgdir/usr/share/javadoc" "$srcdir/_java/usr/share"

  rm -frv "$pkgdir/usr/share/javadoc"
  rm -frv "$pkgdir/boot"
  rm -frv "$pkgdir/usr/lib/modules"
  rm -frv "$pkgdir/usr/src"
  for f in "$pkgdir"/usr/sbin/* ; do
    [ -f "$f" ] && mv -fv "$f" "$pkgdir/usr/bin"
  done
  rm -frv "$pkgdir/usr/sbin"
  sed -i -e '/Generated from/d' "$pkgdir/usr/lib/openss7/testsuite"
  rm -f "$pkgdir/usr/lib/systemd/system/multi-user.target.*"
}

package_openss7-modules-git() {
  _kvv="$(pacman -Qi linux|awk '/^Version/{print$3}')"
  _kvr="${_kvv}-ARCH"
  _kvx="$(echo $_kvr|sed -e 's,\.[0-9][0-9]*-.*,,')"
  _kvn="$(echo $_kvr | sed -e 's,-.*$,,')"
  _kvl="$(echo $_kvr | sed -e 's,\.[0-9][0-9]*-.*$,,')"
  _kvi="$(echo $_kvl | sed -e 's,.*\.,,')"
  _kvi=$((_kvi+1))
  _kvu="3.$_kvi"
  pkgdesc="OpenSS7 Fast-STREAMS and protocol Suites ($_kvx Kernel Modules)"
  provides=("$_pkgbase-kernel=$pkgver"
            "$_pkgbase-modules=$pkgver")
  conflicts=("$_pkgbase-modules")
  depends=("$pkgbase" "linux=$_kvv")
# depends=("$pkgbase" "linux>=$_kvl" "linux<$_kvu")
  options=('!emptydirs' '!strip')
  install="openss7-modules-git.install"

  cd "$srcdir"/openss7-modules-git
  make DESTDIR="$pkgdir" install-strip
  rm -fr "$pkgdir/usr/bin"
  rm -fr "$pkgdir/usr/lib/openss7"
  rm -fr "$pkgdir/usr/share/doc"
  d="$pkgdir/usr/src/$_pkgbase-$pkgver-$pkgrel/$_kvr"
  install -d "$d"
  b="$pkgdir/boot"
  install -d "$b"
  install -m644 ../$CARCH-$_kvr-config.cache     "$d"
  install -m644 ../$CARCH-config.site            "$d"
  install -m644 ../$CARCH-$_kvr-modpost.cache    "$d"
  install -m644 Module.mkvars                    "$d"
  install -m644 System.symvers                   "$d"
  install -m644 Module.symvers                   "$d"
  install -m644 config.h                         "$d"
  cat System.symvers Module.symvers | gzip -9 -c >symvers-${_kvr}.gz
  install -m644 symvers-${_kvr}.gz               "$d"
  install -m644 symvers-${_kvr}.gz               "$b"
  cat Module.symvers|awk '{print$4"\t"$3"\t"$1"\t"$2}' >abi-${_kvr}
  install -m644 abi-${_kvr}                      "$d"
  install -m644 abi-${_kvr}                      "$b"
  install -m644 symsets-${_kvr}.tar.gz           "$d"
  install -m644 symsets-${_kvr}.tar.gz           "$b"
  install -d "$pkgdir"/usr/lib/modules/extramodules-${_kvx}-ARCH
  mv -f "$pkgdir"/usr/lib/modules/${_kvr}/updates/openss7 \
        "$pkgdir"/usr/lib/modules/extramodules-${_kvx}-ARCH
  install -d "$pkgdir"/usr/lib/modules/${_kvr}/build/openss7
  mv -f "$pkgdir"/usr/src/${_pkgbase}-$pkgver-$pkgrel/$_kvr \
        "$pkgdir"/usr/lib/modules/${_kvr}/build/openss7
}

package_openss7-modules-lts-git() {
  _kvv="$(pacman -Qi linux-lts|awk '/^Version/{print$3}')"
  _kvr="${_kvv}-lts"
  _kvx="$(echo $_kvr|sed -e 's,\.[0-9][0-9]*-.*,,')"
  _kvn="$(echo $_kvr | sed -e 's,-.*$,,')"
  _kvl="$(echo $_kvr | sed -e 's,\.[0-9][0-9]*-.*$,,')"
  _kvi="$(echo $_kvl | sed -e 's,.*\.,,')"
  _kvi=$((_kvi+1))
  _kvu="3.$_kvi"
  pkgdesc="OpenSS7 Fast-STREAMS and protocol Suites ($_kvx Kernel Modules)"
  provides=("$_pkgbase-modules-git=$pkgver"
            "$_pkgbase-kernel=$pkgver"
            "$_pkgbase-modules-lts=$pkgver")
  conflicts=("$_pkgbase-modules-lts")
  depends=("$pkgbase" "linux-lts=$_kvv")
# depends=("$pkgbase" "linux-lts>=$_kvl" "linux-lts<$_kvu")
  options=('!emptydirs' '!strip')
  install="openss7-modules-lts-git.install"

  cd "$srcdir"/openss7-modules-lts-git
  make DESTDIR="$pkgdir" install-strip
  rm -fr "$pkgdir/usr/bin"
  rm -fr "$pkgdir/usr/lib/openss7"
  rm -fr "$pkgdir/usr/share/doc"
  d="$pkgdir/usr/src/$_pkgbase-$pkgver-$pkgrel/$_kvr"
  install -d "$d"
  b="$pkgdir/boot"
  install -d "$b"
  install -m644 ../$CARCH-$_kvr-config.cache     "$d"
  install -m644 ../$CARCH-config.site            "$d"
  install -m644 ../$CARCH-$_kvr-modpost.cache    "$d"
  install -m644 Module.mkvars                    "$d"
  install -m644 System.symvers                   "$d"
  install -m644 Module.symvers                   "$d"
  install -m644 config.h                         "$d"
  cat System.symvers Module.symvers | gzip -9 -c >symvers-${_kvr}.gz
  install -m644 symvers-${_kvr}.gz               "$d"
  install -m644 symvers-${_kvr}.gz               "$b"
  cat Module.symvers|awk '{print$4"\t"$3"\t"$1"\t"$2}' >abi-${_kvr}
  install -m644 abi-${_kvr}                      "$d"
  install -m644 abi-${_kvr}                      "$b"
  install -m644 symsets-${_kvr}.tar.gz           "$d"
  install -m644 symsets-${_kvr}.tar.gz           "$b"
  install -d "$pkgdir"/usr/lib/modules/extramodules-${_kvx}-lts
  mv -f "$pkgdir"/usr/lib/modules/${_kvr}/updates/openss7 \
        "$pkgdir"/usr/lib/modules/extramodules-${_kvx}-lts
  install -d "$pkgdir"/usr/lib/modules/${_kvr}/build/openss7
  mv -f "$pkgdir"/usr/src/${_pkgbase}-$pkgver-$pkgrel/$_kvr \
        "$pkgdir"/usr/lib/modules/${_kvr}/build/openss7
}

package_openss7-java-git() {
  pkgdesc="OpenSS7 Fast-STREAMS and Protocol Suites (Java)"
  provides=("$_pkgbase-java=$pkgver")
  conflicts=("$_pkgbase-java")
  depends=("$pkgbase" 'gcc-gcj' 'java-environment')
  install="openss7-java-git.install"

  mv -fv "$srcdir/_java/usr" "$pkgdir/"
}

# vim: sw=2 et