summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 84133e22e3e91655dd37e29826b88922b0c0904f (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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
pkgname=husky-tosser-git
_realpkg=husky
pkgver=r3410.d18b6911
pkgrel=1
arch=('x86_64')
license=('GPL')
makedepends=('git' 'patchelf' 'gawk' 'perl')
depends=('perl')
url="http://husky${_bld_lib}urceforge.net/hpt.html"
pkgdesc="Husky Fido Tosser hpt: Complete bundle (except msged)"
provides=("husky-tosser-git")
conflicts=("husky-git")

source=(
  'bsopack.cmake' 'bsopack.patch'
  'hpt::git+https://github.com/huskyproject/hpt.git'
  'huskylib::git+https://github.com/huskyproject/huskylib.git'
  'fidoconf::git+https://github.com/huskyproject/fidoconf.git'
  'smapi::git+https://github.com/huskyproject/smapi.git'
  'areastat::git+https://github.com/huskyproject/areastat.git'
  'areafix::git+https://github.com/huskyproject/areafix.git'
  'bsopack::git+https://github.com/huskyproject/bsopack.git'
  'sqpack::git+https://github.com/huskyproject/sqpack.git'
  'nltools::git+https://github.com/huskyproject/nltools.git'
  'hptkill::git+https://github.com/huskyproject/hptkill.git'
  'hptzip::git+https://github.com/huskyproject/hptzip.git'
  'hpt::git+https://github.com/huskyproject/hpt.git'
  'htick::git+https://github.com/huskyproject/htick.git'
  'hptsqfix::git+https://github.com/huskyproject/hptsqfix.git'
)

_tosserModules="huskylib fidoconf smapi areafix hpt areastat bsopack sqpack nltools hptkill hptsqfix htick hptzip"
_prefix=/usr
_wanna_shared=1

pkgver() {
    cd ${srcdir}/hpt/
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
    cd ..
}

build() {
    if [[ _wanna_shared -eq 0 ]]; then
        local _bld_shared=OFF
        local _bld_lib=".a"
    else
        local _bld_shared=ON
        local _bld_lib=".so"
    fi
    echo "char cvs_date[]=\"archlinux-git\";" > "cvsdate.h"


    echo "BUILDING husky"
    pushd huskylib
    cp ../cvsdate.h ./
    rm -rf build-archlinux
    cmake  -Bbuild-archlinux \
        -DBUILD_SHARED_LIBS=${_bld_shared} \
        -DCMAKE_INSTALL_PREFIX:PATH=${_prefix} \
        -DCMAKE_FIND_ROOT_PATH=../
    cmake --build build-archlinux
    popd

    echo "BUILDING smapi"
    pushd "smapi"
    rm -rf huskylib
    ln -s "../huskylib/huskylib" huskylib
    cp ../cvsdate.h ./
    rm -rf build-archlinux
    cmake \
        -Bbuild-archlinux -DBUILD_SHARED_LIBS=${_bld_shared} \
        -Dhusky_LIB="../huskylib/build-archlinux" \
        -DCMAKE_INSTALL_PREFIX:PATH=${_prefix} \
        -DCMAKE_INCLUDE_PATH:PATH=../huskylib
    cmake --build build-archlinux
    popd

    echo "BUILDING fidoconf"
    pushd "fidoconf"
    rm -rf huskylib smapi
    ln -s "../huskylib/huskylib" huskylib
    ln -s "../smapi/smapi" smapi
    cp ../cvsdate.h ./
    rm -rf build-archlinux
    cmake \
        -Bbuild-archlinux \
        -DBUILD_SHARED_LIBS=${_bld_shared} \
        -Dhusky_LIB="../huskylib/build-archlinux/libhusky${_bld_lib}" \
        -Dsmapi_LIB="../smapi/build-archlinux/libsmapi${_bld_lib}" \
        -DCMAKE_INSTALL_PREFIX:PATH=${_prefix}
    cmake --build build-archlinux
    popd

    echo "BUILDING areafix"
    pushd "areafix"
    rm -rf build-archlinux
    rm -rf huskylib smapi fidoconf
    ln -s "../huskylib/huskylib" huskylib
    ln -s "../smapi/smapi" smapi
    ln -s "../fidoconf/fidoconf" fidoconf
    cp ../cvsdate.h ./
    cmake \
        -Bbuild-archlinux \
        -DBUILD_SHARED_LIBS=${_bld_shared} \
        -Dhusky_LIB="../huskylib/huskylib" \
        -Dsmapi_LIB="../smapi/smapi" \
        -Dfidoconfig_LIB="../fidoconf/fidoconf" \
        -DCMAKE_INSTALL_PREFIX:PATH=${_prefix}
    cmake --build build-archlinux
    popd

    echo "BUILDING hptzip"
    pushd "hptzip"
    rm -rf build-archlinux
    rm -rf huskylib smapi fidoconf
    ln -s "../huskylib/huskylib" huskylib
    cp ../cvsdate.h ./
    cmake \
        -DCMAKE_INSTALL_PREFIX:PATH=${_prefix} \
        -Bbuild-archlinux \
        -DBUILD_SHARED_LIBS=${_bld_shared} \
        -Dhusky_LIB="../huskylib/build-archlinux/libhusky${_bld_lib}"
    cmake --build build-archlinux
    popd

    echo "BUILDING hpt"
    pushd "hpt"
    rm -rf build-archlinux
    rm -rf huskylib smapi fidoconf hptzip areafix
    ln -s "../huskylib/huskylib" huskylib
    ln -s "../smapi/smapi" smapi
    ln -s "../fidoconf/fidoconf" fidoconf
    ln -s "../hptzip/hptzip" hptzip
    ln -s "../areafix/areafix" areafix
    cp ../cvsdate.h ./
    cmake \
        -Bbuild-archlinux \
        -DBUILD_SHARED_LIBS=${_bld_shared} \
        -Dhptzip_LIB="../hptzip/build-archlinux/libhptzip${_bld_lib}" \
        -Dhusky_LIB="../huskylib/build-archlinux/libhusky${_bld_lib}" \
        -Dsmapi_LIB="../smapi/build-archlinux/libsmapi${_bld_lib}" \
        -Dfidoconfig_LIB="../fidoconf/build-archlinux/libfidoconfig${_bld_lib}" \
        -Dareafix_LIB="../areafix/build-archlinux/libareafix${_bld_lib}" \
        -DCMAKE_INSTALL_PREFIX:PATH=${_prefix}
    cmake --build build-archlinux
    popd

    echo "BUILDING areastat"
    pushd areastat
    rm -rf build-archlinux
    cp ../cvsdate.h ./
    cp ../cvsdate.h ./h/
    rm -rf huskylib smapi fidoconf
    ln -s "../huskylib/huskylib" huskylib
    ln -s "../smapi/smapi" smapi
    ln -s "../fidoconf/fidoconf" fidoconf
    cp ../cvsdate.h ./
    cmake \
        -Bbuild-archlinux \
        -DBUILD_SHARED_LIBS=${_bld_shared} \
        -Dhusky_LIB="../huskylib/build-archlinux/libhusky${_bld_lib}" \
        -Dsmapi_LIB="../smapi/build-archlinux/libsmapi${_bld_lib}" \
        -DCMAKE_INSTALL_PREFIX:PATH=${_prefix}
    cmake --build build-archlinux
    popd

    echo "BUILDING hptsqfix"
    pushd hptsqfix
    rm -rf build-archlinux
    cp ../cvsdate.h ./
    cp ../cvsdate.h ./h/
    rm -rf huskylib smapi fidoconf
    ln -s "../huskylib/huskylib" huskylib
    ln -s "../smapi/smapi" smapi
    ln -s "../fidoconf/fidoconf" fidoconf
    cp ../cvsdate.h ./
    cmake \
        -Bbuild-archlinux \
        -DBUILD_SHARED_LIBS=${_bld_shared} \
        -Dhusky_LIB="../huskylib/build-archlinux/libhusky${_bld_lib}" \
        -Dfidoconfig_LIB="../fidoconf/build-archlinux/libfidoconfig${_bld_lib}" \
        -Dsmapi_LIB="../smapi/build-archlinux/libsmapi${_bld_lib}" \
        -DCMAKE_INSTALL_PREFIX:PATH=${_prefix}
    cmake --build build-archlinux
    popd

    echo "BUILDING htick"
    pushd htick
    rm -rf build-archlinux
    cp ../cvsdate.h ./
    rm -rf huskylib smapi fidoconf hptzip areafix
    ln -s "../huskylib/huskylib" huskylib
    ln -s "../smapi/smapi" smapi
    ln -s "../fidoconf/fidoconf" fidoconf
    ln -s "../hptzip/hptzip" hptzip
    ln -s "../areafix/areafix" areafix
    cp ../cvsdate.h ./
    cmake \
        -Bbuild-archlinux \
        -DBUILD_SHARED_LIBS=${_bld_shared} \
        -Dhusky_LIB="../huskylib/build-archlinux/libhusky${_bld_lib}" \
        -Dfidoconfig_LIB="../fidoconf/build-archlinux/libfidoconfig${_bld_lib}" \
        -Dsmapi_LIB="../smapi/build-archlinux/libsmapi${_bld_lib}" \
        -Dareafix_LIB="../areafix/build-archlinux/libareafix${_bld_lib}" \
        -DCMAKE_INSTALL_PREFIX:PATH=${_prefix}
    cmake --build build-archlinux
    popd

    echo "BUILDING hptkill"
    pushd hptkill
    rm -rf build-archlinux
    cp ../cvsdate.h ./
    rm -rf huskylib smapi fidoconf hptzip
    ln -s "../huskylib/huskylib" huskylib
    ln -s "../smapi/smapi" smapi
    ln -s "../fidoconf/fidoconf" fidoconf
    ln -s "../hptzip/hptzip" hptzip
    cp ../cvsdate.h ./
    cmake \
        -Bbuild-archlinux \
        -DBUILD_SHARED_LIBS=${_bld_shared} \
        -Dhusky_LIB="../huskylib/build-archlinux/libhusky${_bld_lib}" \
        -Dfidoconfig_LIB="../fidoconf/build-archlinux/libfidoconfig${_bld_lib}" \
        -Dsmapi_LIB="../smapi/build-archlinux/libsmapi${_bld_lib}" \
        -DCMAKE_INSTALL_PREFIX:PATH=${_prefix}
    cmake --build build-archlinux
    popd

    echo "BUILDING nltools"
    pushd nltools
    rm -rf build-archlinux
    cp ../cvsdate.h ./
    cp ../cvsdate.h ./h
    rm -rf huskylib smapi fidoconf hptzip
    ln -s "../huskylib/huskylib" huskylib
    ln -s "../smapi/smapi" smapi
    ln -s "../fidoconf/fidoconf" fidoconf
    ln -s "../hptzip/hptzip" hptzip
    cp ../cvsdate.h ./
    cmake \
        -Bbuild-archlinux \
        -DBUILD_SHARED_LIBS=${_bld_shared} \
        -Dhptzip_LIB="../hptzip/build-archlinux/libhptzip${_bld_lib}" \
        -Dhusky_LIB="../huskylib/build-archlinux/libhusky${_bld_lib}" \
        -Dfidoconfig_LIB="../fidoconf/build-archlinux/libfidoconfig${_bld_lib}" \
        -Dsmapi_LIB="../smapi/build-archlinux/libsmapi${_bld_lib}" \
        -DCMAKE_INSTALL_PREFIX:PATH=${_prefix}
    cmake --build build-archlinux
    popd

    echo "BUILDING sqpack"
    pushd sqpack
    rm -rf build-archlinux
    rm -rf huskylib smapi fidoconf hptzip
    ln -s "../huskylib/huskylib" huskylib
    ln -s "../smapi/smapi" smapi
    ln -s "../fidoconf/fidoconf" fidoconf
    ln -s "../hptzip/hptzip" hptzip
    cp ../cvsdate.h ./
    cmake \
        -Bbuild-archlinux \
        -DBUILD_SHARED_LIBS=${_bld_shared} \
        -Dhptzip_LIB="../hptzip/build-archlinux/libhptzip${_bld_lib}" \
        -Dhusky_LIB="../huskylib/build-archlinux/libhusky${_bld_lib}" \
        -Dfidoconfig_LIB="../fidoconf/build-archlinux/libfidoconfig${_bld_lib}" \
        -Dsmapi_LIB="../smapi/build-archlinux/libsmapi${_bld_lib}" \
        -DCMAKE_INSTALL_PREFIX:PATH=${_prefix}
    cmake --build build-archlinux
    popd


    echo "BUILDING bsopack"
    cp bsopack.cmake bsopack/CMakeLists.txt
    pushd bsopack
    patch -p1 -i ../bsopack.patch
    cp ../cvsdate.h ./
    rm -rf build-archlinux
    cmake \
        -Bbuild-archlinux \
        -DBUILD_SHARED_LIBS=${_bld_shared} \
        -Dhusky_LIB="../huskylib/build-archlinux/libhusky${_bld_lib}" \
        -Dfidoconfig_LIB="../fidoconf/build-archlinux/libfidoconfig${_bld_lib}" \
        -Dsmapi_LIB="../smapi/build-archlinux/libsmapi${_bld_lib}" \
        -DCMAKE_INSTALL_PREFIX:PATH=${_prefix}
    cmake --build build-archlinux
    popd

    echo "BUILDING nltools"
    pushd nltools
    rm -rf build-archlinux
    rm -rf huskylib smapi fidoconf hptzip
    ln -s "../huskylib/huskylib" huskylib
    ln -s "../smapi/smapi" smapi
    ln -s "../fidoconf/fidoconf" fidoconf
    ln -s "../hptzip/hptzip" hptzip
    cp ../cvsdate.h ./
    cmake \
        -Bbuild-archlinux \
        -DBUILD_SHARED_LIBS=${_bld_shared} \
        -Dcurses_LIB="/usr/lib/libcursesw.so" \
        -Dhptzip_LIB="../hptzip/build-archlinux/libhptzip${_bld_lib}" \
        -Dhusky_LIB="../huskylib/build-archlinux/libhusky${_bld_lib}" \
        -Dfidoconfig_LIB="../fidoconf/build-archlinux/libfidoconfig${_bld_lib}" \
        -Dsmapi_LIB="../smapi/build-archlinux/libsmapi${_bld_lib}" \
        -DCMAKE_INSTALL_PREFIX:PATH=${_prefix}
    cmake --build build-archlinux
    popd

}

package() {
    for i in $_tosserModules; do
        pushd "${i}/build-archlinux"
        make DESTDIR="$pkgdir" install
        popd
    done
    RPATH_FOR_PERL_FULL=$(ldd "hpt/build-archlinux/hpt" | grep libperl\.so | awk '{ print $3; }')
    RPATH_FOR_PERL=$(dirname "${RPATH_FOR_PERL_FULL}")
    patchelf --set-rpath "${RPATH_FOR_PERL}" "${pkgdir}/usr/bin/hpt"
}
sha256sums=('73a603d930e184a1d094f53311916b4f8dcd8f7c31ea3373e236e797a3341a15'
            'c5bb6b91f34b23cb1d2f9cff5d8d0956ce372cca3b602ada87ff3b4375498ea7'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP')