Compare commits
382 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c1326d82af | ||
|
b60ddd4560 | ||
|
b82b10135e | ||
|
e35da2ef75 | ||
|
c3ba9ccbd8 | ||
|
4e2983c83c | ||
|
5b2544a8cc | ||
|
298bd4e3dd | ||
|
59959cc216 | ||
|
153f50041f | ||
|
975f21c108 | ||
|
55f62273c3 | ||
|
6499cbc4e2 | ||
|
e736d6cdbe | ||
|
7de08b499a | ||
|
d190fa9b04 | ||
|
4972b52b10 | ||
|
8bce457cb2 | ||
|
5c4bfea95e | ||
|
95e211cd84 | ||
|
37fe2b4ab7 | ||
|
3124474192 | ||
|
02ff4a6bb7 | ||
|
87df4b821c | ||
|
6e6bc8e4a6 | ||
|
3c4760fac8 | ||
|
4887078b34 | ||
|
cae5ea467c | ||
|
1ffadfb29d | ||
|
ae3cfff251 | ||
|
0a4591897c | ||
|
47ac404ddc | ||
|
ca7fad4882 | ||
|
811c5a99f0 | ||
|
2e2b672417 | ||
|
b058836dae | ||
|
ba39d46794 | ||
|
bd0af716de | ||
|
1306c9a80d | ||
|
5f6ff9c55c | ||
|
bc93aaa088 | ||
|
f2e3e0f014 | ||
|
0d7493589a | ||
|
32c4fa64af | ||
|
b838259f68 | ||
|
f3be8b6bc2 | ||
|
7faec45fdd | ||
|
97922d41b7 | ||
|
3643446b23 | ||
|
272d2b048a | ||
|
ea9bb846fc | ||
|
ff7270f82d | ||
|
b78d93fec3 | ||
|
430e328400 | ||
|
5d5eac137c | ||
|
4c35941d50 | ||
|
0bab6b0296 | ||
|
5969f32695 | ||
|
2cfb9bdb77 | ||
|
195b0fadb8 | ||
|
d6e0ba914f | ||
|
445740902c | ||
|
635a0ea454 | ||
|
38f99a79b3 | ||
|
7855aaa8f1 | ||
|
c17dd21b04 | ||
|
78b7c8e144 | ||
|
7b97799ed4 | ||
|
6ed0be7ab1 | ||
|
195cbddf39 | ||
|
836ded9751 | ||
|
2fb629fb9b | ||
|
b1fc196577 | ||
|
09527a512d | ||
|
473b736053 | ||
|
66fe267a12 | ||
|
df54044203 | ||
|
f1517cd581 | ||
|
89fc8859a1 | ||
|
ae0985a107 | ||
|
5517c1f361 | ||
|
cab483029e | ||
|
3a48002a94 | ||
|
a3ef23ec78 | ||
|
37e9abdf73 | ||
|
ebdd0063dd | ||
|
9c211a6a35 | ||
|
1f50906382 | ||
|
55f359cbaa | ||
|
deba8275bf | ||
|
28274f8b3a | ||
|
46a6bfd423 | ||
|
f279bff6ad | ||
|
b7996800fb | ||
|
e3aad73232 | ||
|
ef1f187fbb | ||
|
ad5af6773a | ||
|
54d5511eb7 | ||
|
a9571f976d | ||
|
e107a783d5 | ||
|
411d61ddf0 | ||
|
83eef9382a | ||
|
d0eef0681b | ||
|
68da07a47a | ||
|
8539a717fc | ||
|
52dc56db34 | ||
|
701fee7294 | ||
|
452a250213 | ||
|
64dfda4d2c | ||
|
c43600a4a0 | ||
|
84a7696ad1 | ||
|
40e1493069 | ||
|
d8c629ddd4 | ||
|
2d136c9538 | ||
|
0592593f31 | ||
|
96d4e688f4 | ||
|
986f88ae73 | ||
|
27b17fb15e | ||
|
2596046682 | ||
|
a1d8cc2ddc | ||
|
84c32ecae9 | ||
|
41e9ee727e | ||
|
d364972a87 | ||
|
7e15be0963 | ||
|
a619695bba | ||
|
5bd7efd601 | ||
|
e7a174af5b | ||
|
124ef72e77 | ||
|
d609014ce9 | ||
|
d5bd4b883e | ||
|
bf5ed29b0f | ||
|
c5902ba33f | ||
|
e5d78dcff4 | ||
|
3bf0b8f083 | ||
|
c112f40782 | ||
|
0c236fe8e5 | ||
|
cfbdfc60ac | ||
|
d1251119aa | ||
|
fb48383d9f | ||
|
f0f6b5560d | ||
|
53322a25a5 | ||
|
ab3cb96b9e | ||
|
3d27a15aad | ||
|
0b6b0198da | ||
|
c2213a0236 | ||
|
a706fe5472 | ||
|
47247e4150 | ||
|
81726e4857 | ||
|
efcc8cce75 | ||
|
9460154623 | ||
|
c13aaea995 | ||
|
d80a2ea958 | ||
|
edf9be1b39 | ||
|
07399a8849 | ||
|
856d8134b6 | ||
|
170e2188e9 | ||
|
1107962ad8 | ||
|
4b3c2433d5 | ||
|
a93d10698f | ||
|
c62456812e | ||
|
e5c8c16492 | ||
|
83e7a4f045 | ||
|
87f872d02b | ||
|
9914f51b1b | ||
|
33502e39eb | ||
|
2da26f9db5 | ||
|
3efe41dd0c | ||
|
19ad5a530b | ||
|
8479b07853 | ||
|
d02dbabc22 | ||
|
7a5198b86b | ||
|
c4f882c42c | ||
|
8598900333 | ||
|
88337f50f5 | ||
|
4ef4fab228 | ||
|
72f890df77 | ||
|
06868afd57 | ||
|
69ab773f59 | ||
|
e91dddece5 | ||
|
e3136771b3 | ||
|
972cb47448 | ||
|
0273f7e1eb | ||
|
e67c7efd4d | ||
|
48199c851a | ||
|
eaa615f948 | ||
|
8f2ef1279a | ||
|
671df91867 | ||
|
f67d26b5d6 | ||
|
98b6135469 | ||
|
e4c93cb77e | ||
|
3ec60c7a31 | ||
|
caadeff016 | ||
|
87a97e89f3 | ||
|
6c6978937a | ||
|
a7b6b974ed | ||
|
649621d68e | ||
|
493f56fc43 | ||
|
585415b5d9 | ||
|
0b2f17698e | ||
|
4d2eb25803 | ||
|
795c0c522b | ||
|
0cd6abba00 | ||
|
db486c2fbb | ||
|
a2f7c2b71a | ||
|
c7830b0a64 | ||
|
8bc7b06720 | ||
|
40a7e828d4 | ||
|
e5c7bca0e8 | ||
|
2e67bb2ce5 | ||
|
49912b0df5 | ||
|
1b79de9a6f | ||
|
f0c10c9f13 | ||
|
e08038a4a4 | ||
|
328fc11463 | ||
|
3790c3a7fb | ||
|
27ddc9ecb2 | ||
|
6dad230ddb | ||
|
54b338816d | ||
|
ecaa01415c | ||
|
80fec1cbd1 | ||
|
aae062eae8 | ||
|
9761c94426 | ||
|
6d8c8e6f0c | ||
|
0dd634c574 | ||
|
1b2339d407 | ||
|
237337a6c6 | ||
|
6910d07de7 | ||
|
73b0bd180f | ||
|
9921428d92 | ||
|
15903c519c | ||
|
f37546310e | ||
|
ff319a0028 | ||
|
7dad4d39bd | ||
|
6153b67702 | ||
|
11c364e456 | ||
|
436bfaf65d | ||
|
59daf96cb2 | ||
|
6af89aa214 | ||
|
4add3928b3 | ||
|
548aff606e | ||
|
44c764437c | ||
|
93b9c369fc | ||
|
8af2ba71ac | ||
|
29279d4a5b | ||
|
ea552a4daf | ||
|
9e0aa2550c | ||
|
bda56fd9b1 | ||
|
4d0b6136b6 | ||
|
82a1405dd8 | ||
|
1433654678 | ||
|
30bb029b38 | ||
|
345bcf3e91 | ||
|
fdb0081a16 | ||
|
b968d18349 | ||
|
2950c5e61e | ||
|
e519a84941 | ||
|
a13d4b8b20 | ||
|
85455e4eb0 | ||
|
880c4fcd5d | ||
|
395cffc7aa | ||
|
c818743e11 | ||
|
20b1088ae2 | ||
|
e0729035a0 | ||
|
798c11607f | ||
|
a32bb68aba | ||
|
73b6ce9c57 | ||
|
4f1f547f24 | ||
|
a8bcd3741f | ||
|
6f947c0328 | ||
|
e399d7ff29 | ||
|
1bb678c64a | ||
|
ca5159471f | ||
|
eb601b5e70 | ||
|
8b059158ba | ||
|
07fccfd9a1 | ||
|
5d116cb4cc | ||
|
a23376405b | ||
|
e330117e14 | ||
|
b95424a06b | ||
|
befa5e103e | ||
|
ae161ab66c | ||
|
1d2eebf689 | ||
|
ac776c377e | ||
|
20cbe43332 | ||
|
59008edb14 | ||
|
1cb0fba5fb | ||
|
7cdea6ff7e | ||
|
bab627bc22 | ||
|
8a8de3a39a | ||
|
8e22621418 | ||
|
1b8536abf1 | ||
|
c013051271 | ||
|
dae8fa2606 | ||
|
fa247e69af | ||
|
bbc5f8f364 | ||
|
8fc16e2daa | ||
|
64b3d676b2 | ||
|
c6d9f1f431 | ||
|
88a603f537 | ||
|
5abcaaca33 | ||
|
89972ec757 | ||
|
8f4190a52c | ||
|
6b6cf52f6d | ||
|
7ffdbdc6d5 | ||
|
8cf968c984 | ||
|
ab41e2f6c8 | ||
|
488948b8d7 | ||
|
fe1a0f23ee | ||
|
2089fc7bf1 | ||
|
19872dc6fe | ||
|
227b33e94e | ||
|
e8e6da4176 | ||
|
683aba9d80 | ||
|
72e5db37b5 | ||
|
d32b4577e8 | ||
|
ebf81c0113 | ||
|
b1204c472c | ||
|
fb65ca3a00 | ||
|
7229f10396 | ||
|
0b163b3d06 | ||
|
bd7f38e058 | ||
|
fb1984734b | ||
|
5995766e80 | ||
|
dfb8f0169d | ||
|
f0b5c1b565 | ||
|
283779dff1 | ||
|
4773ef18ac | ||
|
5d0da9c487 | ||
|
e6a0b6cbfe | ||
|
ed9a00f761 | ||
|
232d0166b5 | ||
|
4b65f2f48e | ||
|
e29cbf2a99 | ||
|
da128f954a | ||
|
1bc67af711 | ||
|
eab5583c0d | ||
|
c81c65671b | ||
|
15b76d9f76 | ||
|
8af86b797a | ||
|
cbf3d70e56 | ||
|
78a6eab552 | ||
|
cd30bb3547 | ||
|
82b34c5629 | ||
|
30ceea2628 | ||
|
c9936dc158 | ||
|
b2d74bab08 | ||
|
75e22924a6 | ||
|
2c0b10d5d5 | ||
|
26005406d3 | ||
|
30f51fc80d | ||
|
1f4312aeaa | ||
|
ee9ff3e826 | ||
|
876ea626db | ||
|
a1abcaaa78 | ||
|
ed934fb2e1 | ||
|
85779fa14f | ||
|
b13abaef50 | ||
|
0f8bb5330b | ||
|
4d6720d40f | ||
|
086f1bc5e0 | ||
|
abebb6d20d | ||
|
c6c20a5951 | ||
|
7d50a02159 | ||
|
21e17e3468 | ||
|
2f1663e620 | ||
|
3ca7af736f | ||
|
7232a81da9 | ||
|
02c69a3bd2 | ||
|
742ca58b86 | ||
|
8c3e84353f | ||
|
17c8f12bbb | ||
|
601aa5ffc1 | ||
|
4e21230c7d | ||
|
428e0de417 | ||
|
28ead10bfc | ||
|
85dddb6d0b | ||
|
f7eafbf000 | ||
|
4e07127a2c | ||
|
07f858eab5 | ||
|
eaf24211e8 | ||
|
a0e7adadfe | ||
|
d9a9b5f4af |
1
.gitignore
vendored
1
.gitignore
vendored
@ -0,0 +1 @@
|
||||
/ghc-rpm-macros-*/
|
10
AUTHORS
10
AUTHORS
@ -1,3 +1,11 @@
|
||||
Maintainer:
|
||||
Jens Petersen <petersen@redhat.com>
|
||||
|
||||
Initial implementation:
|
||||
Bryan O'Sullivan
|
||||
Jens Petersen
|
||||
Yaakov Nemoy
|
||||
Yaakov Nemoy
|
||||
|
||||
Contributions from:
|
||||
Peter Trommler
|
||||
Ondřej Súkup
|
||||
|
34
cabal-tweak-dep-ver
Executable file
34
cabal-tweak-dep-ver
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e +x
|
||||
|
||||
USAGE="Usage: $0 dep old new"
|
||||
|
||||
if [ $# -ne 3 ]; then
|
||||
echo "$USAGE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DEP=$1
|
||||
OLD=$(echo $2 | sed -e "s/*/\\\\*/g" -e "s/\./\\\\./g")
|
||||
NEW=$3
|
||||
|
||||
CABALFILE=$(ls *.cabal)
|
||||
|
||||
if [ $(echo $CABALFILE | wc -w) -ne 1 ]; then
|
||||
echo "There needs to be one .cabal file in the current dir!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BREAK=[^[:alnum:]-]
|
||||
|
||||
if ! grep -q "$BREAK$DEP$BREAK[^,]*$OLD" $CABALFILE; then
|
||||
echo "$CABALFILE does not match: $DEP $OLD"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f $CABALFILE.orig ]; then
|
||||
BACKUP=.orig
|
||||
fi
|
||||
|
||||
sed -i$BACKUP -e "s/\($BREAK$DEP$BREAK[^,]*\)$OLD/\1$NEW/g" $CABALFILE
|
30
cabal-tweak-drop-dep
Executable file
30
cabal-tweak-drop-dep
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e +x
|
||||
|
||||
USAGE="Usage: $0 dep"
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "$USAGE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DEP=$1
|
||||
|
||||
CABALFILE=$(ls *.cabal)
|
||||
|
||||
if [ $(echo $CABALFILE | wc -w) -ne 1 ]; then
|
||||
echo "There needs to be one .cabal file in the current dir!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f $CABALFILE.orig ]; then
|
||||
BACKUP=.orig
|
||||
fi
|
||||
|
||||
if grep "$DEP" $CABALFILE | sed -e "s/$DEP//" | grep -q -e "[A-Za-z]"; then
|
||||
echo "$0: deleting whole $DEP lines not safe - try more precise pattern"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sed -i$BACKUP -e "/$DEP/d" $CABALFILE
|
50
cabal-tweak-flag
Executable file
50
cabal-tweak-flag
Executable file
@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
|
||||
# TODO:
|
||||
# support setting flag when no upstream default
|
||||
|
||||
set -e +x
|
||||
|
||||
USAGE="Usage: $0 FLAG [True|False]"
|
||||
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "$USAGE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FLAG=$1
|
||||
|
||||
NEW=$2
|
||||
case $NEW in
|
||||
True) OLD=False ;;
|
||||
False) OLD=True ;;
|
||||
*) echo "Flag value can only be set to True or False" ; exit 1 ;;
|
||||
esac
|
||||
|
||||
CABALFILE=$(ls *.cabal)
|
||||
|
||||
if [ $(echo $CABALFILE | wc -w) -ne 1 ]; then
|
||||
echo "There needs to be one .cabal file in the current dir!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -q -i "^flag *$FLAG" $CABALFILE; then
|
||||
echo "$CABALFILE does not have flag $FLAG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -A3 -i "^flag *$FLAG" $CABALFILE | grep -q -i "default:"; then
|
||||
echo "$CABALFILE: $FLAG flag might not have a default"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -A3 -i "^flag *$FLAG" $CABALFILE | grep -q -i "default: *$OLD"; then
|
||||
echo "$CABALFILE: $FLAG flag already defaults to $NEW"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f $CABALFILE.orig ]; then
|
||||
BACKUP=.orig
|
||||
fi
|
||||
|
||||
sed -i$BACKUP -e "/[Ff]lag *$FLAG/,/[Dd]efault: *$OLD/ s/\( \+\)\([Dd]efault:[ \t]*\)$OLD/\1\2$NEW\n\1manual: True/" $CABALFILE
|
43
ghc-deps.sh
Executable file
43
ghc-deps.sh
Executable file
@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
# find rpm provides and requires for Haskell GHC libraries
|
||||
|
||||
[ $# -ne 2 ] && echo "Usage: $(basename $0) [--provides|--requires] %{buildroot}%{ghclibdir}" && exit 1
|
||||
|
||||
set +x
|
||||
|
||||
mode=$1
|
||||
pkgbasedir=$2
|
||||
pkgconfdir=$pkgbasedir/package.conf.d
|
||||
|
||||
ghc_pkg="/usr/lib/rpm/ghc-pkg-wrapper $pkgbasedir"
|
||||
|
||||
case $mode in
|
||||
--provides) field=id ;;
|
||||
--requires) field=depends ;;
|
||||
*) echo "$(basename $0): Need --provides or --requires"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
ghc_ver=$(basename $pkgbasedir | sed -e s/ghc-//)
|
||||
|
||||
files=$(cat)
|
||||
|
||||
for i in $files; do
|
||||
case $i in
|
||||
# exclude builtin_rts.conf
|
||||
$pkgconfdir/*-*.conf)
|
||||
name=$(grep "^name: " $i | sed -e "s/name: //")
|
||||
ids=$($ghc_pkg field $name $field | sed -e "s/rts//" -e "s/bin-package-db-[^ ]\+//")
|
||||
|
||||
for d in $ids; do
|
||||
case $d in
|
||||
*-*) echo "ghc-devel($d)" ;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
32
ghc-pkg-wrapper
Executable file
32
ghc-pkg-wrapper
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ $# -lt 1 ] && echo "Usage: `basename $0` %{buildroot}%{ghclibdir} ..." && exit 1
|
||||
|
||||
set +x
|
||||
|
||||
PKGBASEDIR=$1
|
||||
shift
|
||||
PKGCONFDIR=$PKGBASEDIR/package.conf.d
|
||||
GHC_VER=$(basename $PKGBASEDIR | sed -e s/ghc-//)
|
||||
|
||||
# for a ghc build use the new ghc-pkg
|
||||
INPLACE_GHCPKG=$PKGBASEDIR/../../bin/ghc-pkg-$GHC_VER
|
||||
|
||||
if [ -x "$INPLACE_GHCPKG" ]; then
|
||||
case $GHC_VER in
|
||||
7.4.*)
|
||||
GHC_PKG="$PKGBASEDIR/ghc-pkg --global-conf=$PKGCONFDIR"
|
||||
;;
|
||||
7.6.*)
|
||||
GHC_PKG="$PKGBASEDIR/ghc-pkg --global-package-db=$PKGCONFDIR"
|
||||
;;
|
||||
# 7.8 and 7.10
|
||||
*)
|
||||
GHC_PKG="env LD_LIBRARY_PATH=$(dirname $PKGBASEDIR) $PKGBASEDIR/bin/ghc-pkg --global-package-db=$PKGCONFDIR"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
GHC_PKG="/usr/bin/ghc-pkg-${GHC_VER} -f $PKGCONFDIR"
|
||||
fi
|
||||
|
||||
$GHC_PKG -v0 --simple-output $* | uniq
|
@ -1,240 +0,0 @@
|
||||
# RPM Macros for packaging Haskell cabalized packages -*-rpm-spec-*-
|
||||
# see https://fedoraproject.org/wiki/PackagingDrafts/Haskell for more details
|
||||
|
||||
# "cabal"
|
||||
%cabal %{_bindir}/runghc Setup
|
||||
|
||||
# configure
|
||||
%cabal_configure \
|
||||
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{ghcdocdir} --libsubdir='$compiler/$pkgid' --ghc %{!?ghc_without_shared:--enable-shared} %{?cabal_configure_options}
|
||||
|
||||
# install
|
||||
%cabal_install %cabal copy --destdir=${RPM_BUILD_ROOT} -v
|
||||
|
||||
# root dir for ghc docs
|
||||
%ghcdocbasedir %{_docdir}/ghc/html
|
||||
# ghcdocdir [pkgname]
|
||||
%ghcdocdir() %{ghcdocbasedir}/libraries/%{?1}%{!?1:%{pkg_name}}-%{version}
|
||||
# top library dir
|
||||
%ghcpkgbasedir %{_libdir}/ghc-%{ghc_version}
|
||||
# ghcpkgdir [pkgname]
|
||||
%ghcpkgdir() %{ghcpkgbasedir}/%{?1}%{!?1:%{pkg_name}}-%{version}
|
||||
|
||||
# ghc_gen_filelists [pkgname]
|
||||
%ghc_gen_filelists() \
|
||||
pkgname=%{?1}%{!?1:%{pkg_name}} \
|
||||
basefile=ghc-${pkgname} \
|
||||
pkgnamever=${pkgname}-%{version} \
|
||||
rm -f ${basefile}.files ${basefile}-devel.files ${basefile}-prof.files ${basefile}-doc.files \
|
||||
%if %{undefined ghc_without_shared}\
|
||||
echo "%defattr(-,root,root,-)" > ${basefile}.files \
|
||||
if [ -d "${RPM_BUILD_ROOT}%{ghcpkgdir}" ]; then \
|
||||
echo "%dir %{ghcpkgdir}" >> ${basefile}.files \
|
||||
echo "%attr(755,root,root) %{ghcpkgdir}/libHS${pkgnamever}-ghc%{ghc_version}.so" >> ${basefile}.files \
|
||||
fi \
|
||||
%endif \
|
||||
echo "%defattr(-,root,root,-)" > ${basefile}-devel.files \
|
||||
if [ -d "${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version}" ]; then \
|
||||
%{!?1:echo "%{_docdir}/%{name}-%{version}" >> ${basefile}%{?ghc_without_shared:-devel}.files} %{?1::} \
|
||||
fi \
|
||||
echo "%{ghcpkgbasedir}/package.conf.d/${pkgnamever}*.conf" >> ${basefile}-devel.files \
|
||||
if [ -d "${RPM_BUILD_ROOT}%{ghcpkgdir}" ]; then \
|
||||
find ${RPM_BUILD_ROOT}%{ghcpkgdir} -type d | sed "s/^/%dir /" >> ${basefile}-devel.files \
|
||||
find ${RPM_BUILD_ROOT}%{ghcpkgdir} ! \\( -type d -o -name "*_p.a" -o -name "*.p_hi" -o -name "libHS*.so" \\) >> ${basefile}-devel.files \
|
||||
fi \
|
||||
echo "%defattr(-,root,root,-)" > ${basefile}-prof.files \
|
||||
if [ -d "${RPM_BUILD_ROOT}%{ghcpkgdir}" ]; then \
|
||||
find ${RPM_BUILD_ROOT}%{ghcpkgdir} \\( -name "*_p.a" -o -name "*.p_hi" \\) >> ${basefile}-prof.files \
|
||||
fi \
|
||||
echo "%defattr(-,root,root,-)" > ${basefile}-doc.files \
|
||||
if [ -d "${RPM_BUILD_ROOT}%{ghcdocdir}" ]; then \
|
||||
echo "%{ghcdocdir}" >> ${basefile}-doc.files \
|
||||
fi \
|
||||
sed -i -e "s!${RPM_BUILD_ROOT}!!g" %{!?ghc_without_shared:${basefile}.files} ${basefile}-devel.files ${basefile}-prof.files \
|
||||
%{nil}
|
||||
|
||||
# compiler version
|
||||
%ghc_version %{!?ghc_version_override:%(ghc --numeric-version)}%{?ghc_version_override}
|
||||
|
||||
# create and install package.conf file
|
||||
# cabal_pkg_conf [pkgname]
|
||||
%cabal_pkg_conf \
|
||||
%cabal register --gen-pkg-config \
|
||||
mkdir -p $RPM_BUILD_ROOT%{ghcpkgbasedir}/package.conf.d \
|
||||
install --mode=0644 %{?1}%{!?1:%{pkg_name}}-%{version}.conf $RPM_BUILD_ROOT%{ghcpkgbasedir}/package.conf.d
|
||||
|
||||
# devel pkg basic requires
|
||||
%ghc_requires Requires: ghc = %{ghc_version}\
|
||||
Requires(post): ghc = %{ghc_version}\
|
||||
Requires(postun): ghc = %{ghc_version}\
|
||||
%if %{undefined ghc_without_shared}\
|
||||
Requires: ghc-%{-n:%{-n*}}%{!-n:%{pkg_name}} = %{-v:%{-v*}}%{!-v:%{version}}-%{release}\
|
||||
%endif
|
||||
|
||||
# doc pkg basic requires
|
||||
%ghc_doc_requires Requires: ghc-doc = %{ghc_version}\
|
||||
Requires(post): ghc-doc = %{ghc_version}\
|
||||
Requires(postun): ghc-doc = %{ghc_version}
|
||||
|
||||
# prof pkg basic requires
|
||||
%ghc_prof_requires Requires: ghc-prof = %{ghc_version}\
|
||||
Requires: ghc-%{-n:%{-n*}}%{!-n:%{pkg_name}}-devel = %{-v:%{-v*}}%{!-v:%{version}}-%{release}
|
||||
|
||||
# ghc_lib_package [-n pkgname] [-c cdepslist] [-h pkgdepslist]
|
||||
%ghc_lib_package(n:c:h:)\
|
||||
%define ghc_pkg_name ghc-%{-n:%{-n*}}%{!-n:%{pkg_name}}\
|
||||
%if %{undefined ghc_without_shared}\
|
||||
%files -n %{ghc_pkg_name} -f %{ghc_pkg_name}.files\
|
||||
%defattr(-,root,root,-)\
|
||||
%endif\
|
||||
\
|
||||
%ghc_package_devel\
|
||||
\
|
||||
%ghc_package_doc\
|
||||
\
|
||||
%ghc_package_prof\
|
||||
%{nil}
|
||||
|
||||
# ghc_binlib_package [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-v version]
|
||||
%ghc_binlib_package(n:c:h:l:v:)\
|
||||
%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
|
||||
%define ghc_pkg_name ghc-%{local_pkg_name}\
|
||||
%package -n %{ghc_pkg_name}\
|
||||
Summary: %{?common_summary}%{!?common_summary:%{local_pkg_name} library}\
|
||||
Group: System Environment/Libraries\
|
||||
%{-v:Version: %{-v*}}\
|
||||
%{-l:License: %{-l*}}\
|
||||
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1/g")}\
|
||||
\
|
||||
%description -n %{ghc_pkg_name}\
|
||||
%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}\
|
||||
\
|
||||
%if %{defined ghc_version} && %{undefined ghc_without_shared}\
|
||||
This package provides the shared library.\
|
||||
%endif\
|
||||
\
|
||||
%ghc_lib_package\
|
||||
%{nil}
|
||||
|
||||
%ghc_pkg_recache %{_bindir}/ghc-pkg recache --no-user-package-conf || :
|
||||
|
||||
# ghc_package_devel [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-v version]
|
||||
%ghc_package_devel(n:c:h:l:v:)\
|
||||
%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
|
||||
%define ghc_pkg_name ghc-%{local_pkg_name}\
|
||||
%package -n %{ghc_pkg_name}-devel\
|
||||
Summary: %{?common_summary}%{!?common_summary:%{local_pkg_name} library} development files\
|
||||
Group: Development/Libraries\
|
||||
%{-v:Version: %{-v*}}\
|
||||
%{-l:License: %{-l*}}\
|
||||
%{?ghc_requires}\
|
||||
%{!-h:%{?ghc_pkg_deps:Requires: %{ghc_pkg_deps}}}\
|
||||
%{-h:Requires: %{-h*}}\
|
||||
%{!-c:%{?ghc_pkg_c_deps:Requires: %{ghc_pkg_c_deps}}}\
|
||||
%{-c:Requires: %{-c*}}\
|
||||
%{?ghc_pkg_obsoletes:Obsoletes: %{ghc_pkg_obsoletes}}\
|
||||
\
|
||||
%description -n %{ghc_pkg_name}-devel\
|
||||
%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}\
|
||||
\
|
||||
This package contains the development files.\
|
||||
\
|
||||
%post -n %{ghc_pkg_name}-devel\
|
||||
%ghc_pkg_recache\
|
||||
\
|
||||
%postun -n %{ghc_pkg_name}-devel\
|
||||
%ghc_pkg_recache\
|
||||
\
|
||||
%files -n %{ghc_pkg_name}-devel -f %{ghc_pkg_name}-devel.files\
|
||||
%defattr(-,root,root,-)\
|
||||
%{nil}
|
||||
|
||||
# for docs post and postun
|
||||
# re-index haddock
|
||||
%ghc_reindex_haddock ( cd %{ghcdocbasedir}/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index ) || :
|
||||
|
||||
# ghc_package_doc [-n pkgname] [-h pkgdepslist] [-l licensetag] [-v version]
|
||||
%ghc_package_doc(n:h:l:v:)\
|
||||
%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
|
||||
%define ghc_pkg_name ghc-%{local_pkg_name}\
|
||||
%package -n %{ghc_pkg_name}-doc\
|
||||
Summary: Documentation for %{?common_summary}%{!?common_summary:%{local_pkg_name} library}\
|
||||
Group: Development/Libraries\
|
||||
%{-v:Version: %{-v*}}\
|
||||
%{-l:License: %{-l*}}\
|
||||
%{?ghc_doc_requires}\
|
||||
%{!-h:%{?ghc_pkg_deps:Requires: %(echo %{ghc_pkg_deps} | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-doc/g")}}\
|
||||
%{-h:Requires: %(echo %{-h*} | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-doc/g")}\
|
||||
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-doc/g")}\
|
||||
\
|
||||
%description -n %{ghc_pkg_name}-doc\
|
||||
%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}\
|
||||
\
|
||||
This package contains development documentation files.\
|
||||
\
|
||||
%post -n %{ghc_pkg_name}-doc\
|
||||
%ghc_reindex_haddock\
|
||||
\
|
||||
%postun -n %{ghc_pkg_name}-doc\
|
||||
if [ "$1" -eq 0 ] ; then\
|
||||
%ghc_reindex_haddock\
|
||||
fi\
|
||||
\
|
||||
%files -n %{ghc_pkg_name}-doc -f %{ghc_pkg_name}-doc.files\
|
||||
%defattr(-,root,root,-)\
|
||||
%{nil}
|
||||
|
||||
# ghc_package_prof [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-v version]
|
||||
%ghc_package_prof(n:h:l:v:)\
|
||||
%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
|
||||
%define ghc_pkg_name ghc-%{local_pkg_name}\
|
||||
%package -n %{ghc_pkg_name}-prof\
|
||||
Summary: Profiling libraries for %{?common_summary}%{!?common_summary:%{local_pkg_name}}\
|
||||
Group: Development/Libraries\
|
||||
%{-v:Version: %{-v*}}\
|
||||
%{-l:License: %{-l*}}\
|
||||
%{?ghc_prof_requires}\
|
||||
%{!-h:%{?ghc_pkg_deps:Requires: %(echo "%{ghc_pkg_deps}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}}\
|
||||
%{-h:Requires: %(echo "%{-h*}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}\
|
||||
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}\
|
||||
\
|
||||
%description -n %{ghc_pkg_name}-prof\
|
||||
%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}\
|
||||
\
|
||||
This package contains the profiling library.\
|
||||
\
|
||||
%files -n %{ghc_pkg_name}-prof -f %{ghc_pkg_name}-prof.files\
|
||||
%defattr(-,root,root,-)\
|
||||
%{nil}
|
||||
|
||||
# ghc_strip_dynlinked
|
||||
%ghc_strip_dynlinked\
|
||||
%if %{undefined __debug_package}\
|
||||
find $RPM_BUILD_ROOT -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -exec strip "{}" \\;\
|
||||
%endif
|
||||
|
||||
# ghc_bin_build
|
||||
%ghc_bin_build\
|
||||
%global debug_package %{nil}\
|
||||
%cabal_configure %{!?ghc_without_dynamic:--ghc-option=-dynamic}\
|
||||
%cabal build
|
||||
|
||||
# ghc_lib_build
|
||||
%ghc_lib_build\
|
||||
%global debug_package %{nil}\
|
||||
%cabal_configure %{!?without_prof:-p}\
|
||||
%cabal build\
|
||||
%{!?without_haddock:%cabal haddock %{?with_hscolour:--hyperlink-source}}\
|
||||
%{nil}
|
||||
|
||||
# install bin package
|
||||
%ghc_bin_install\
|
||||
%cabal_install\
|
||||
%ghc_strip_dynlinked
|
||||
|
||||
# install lib package
|
||||
%ghc_lib_install\
|
||||
%cabal_install\
|
||||
%cabal_pkg_conf\
|
||||
%ghc_gen_filelists\
|
||||
%ghc_strip_dynlinked
|
1050
ghc-rpm-macros.spec
1050
ghc-rpm-macros.spec
File diff suppressed because it is too large
Load Diff
3
ghc.attr
Normal file
3
ghc.attr
Normal file
@ -0,0 +1,3 @@
|
||||
%__ghc_provides %{_rpmconfigdir}/ghc-deps.sh --provides %{buildroot}%{ghclibdir}
|
||||
%__ghc_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot}%{ghclibdir}
|
||||
%__ghc_path ^%{ghclibdir}/package.conf.d/.*\.conf$
|
241
macros.ghc
Normal file
241
macros.ghc
Normal file
@ -0,0 +1,241 @@
|
||||
# RPM Macros for packaging Haskell cabalized packages -*-rpm-spec-*-
|
||||
# see https://fedoraproject.org/wiki/Packaging:Haskell for more details
|
||||
|
||||
# "cabal"
|
||||
%cabal [ -x Setup ] || ghc --make %{!?ghc_user_conf:-no-user-package-db} %{!?ghc_static_setup:-dynamic} Setup\
|
||||
LANG=C.utf8\
|
||||
./Setup
|
||||
|
||||
# compiler version
|
||||
%ghc_version %{!?ghc_version_override:%(ghc --numeric-version)}%{?ghc_version_override}
|
||||
|
||||
|
||||
%ghc_set_gcc_flags\
|
||||
# -Wunused-label is extremely noisy\
|
||||
%ifarch s390x\
|
||||
CFLAGS="${CFLAGS:-$(echo %optflags | sed -e 's/-Wall //' -e 's/-Werror=format-security //')}"\
|
||||
%else\
|
||||
CFLAGS="${CFLAGS:-%optflags}"\
|
||||
%endif\
|
||||
export CFLAGS\
|
||||
%global _hardened_ldflags %{nil}\
|
||||
export LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"\
|
||||
%{nil}
|
||||
|
||||
# configure
|
||||
%cabal_configure\
|
||||
%ghc_set_gcc_flags\
|
||||
if ! [ -f Setup.hs -o -f Setup.lhs ]; then\
|
||||
cp %{_datadir}/ghc-rpm-macros/Setup.hs .\
|
||||
fi\
|
||||
%cabal --version\
|
||||
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler/$pkgid' --datasubdir='$pkgid' --libexecsubdir='$pkgid' --ghc %{?_ghcdynlibdir:--dynlibdir=%{_ghcdynlibdir}} %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} --ghc-options="${CFLAGS:+$(echo ' '$CFLAGS | sed -e 's/ / -optc/g')} ${LDFLAGS:+$(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')}" --disable-executable-stripping --disable-library-stripping %{?cabal_configure_options} $cabal_configure_extra_options
|
||||
|
||||
# install
|
||||
%cabal_install %cabal copy --destdir=%{buildroot} %{?cabal_install_options}
|
||||
|
||||
# tests
|
||||
%cabal_test\
|
||||
%if %{with tests}\
|
||||
%cabal test %{?cabal_test_options}\
|
||||
%endif
|
||||
|
||||
# no _pkgdocdir in EPEL <= 7
|
||||
%ghc_pkgdocdir %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
|
||||
|
||||
# root dir for ghc docs (used by ghc.spec)
|
||||
%ghc_html_dir %{_docdir}/ghc/html
|
||||
# deprecates
|
||||
%ghcdocbasedir %ghc_html_dir
|
||||
|
||||
# libraries doc dir (internal)
|
||||
%ghc_html_libraries_dir %{ghc_html_dir}/libraries
|
||||
# deprecates
|
||||
%ghclibdocdir %ghc_html_libraries_dir
|
||||
|
||||
# pkg doc dir
|
||||
%ghc_html_pkg_dir %{ghc_html_libraries_dir}/%{pkg_name}-%{version}
|
||||
# deprecates
|
||||
%ghcpkgdocdir %ghc_html_pkg_dir
|
||||
|
||||
# top library dir
|
||||
%ghclibdir %{_libdir}/ghc-%{ghc_version}
|
||||
|
||||
%_ghclicensedir %{?_defaultlicensedir}%{!?_defaultlicensedir:%_docdir}
|
||||
|
||||
# ghc_gen_filelists [name] [version]
|
||||
%ghc_gen_filelists()\
|
||||
%define pkgname %{?1}%{!?1:%{pkg_name}}\
|
||||
%define pkgver %{?2}%{!?2:%{version}}\
|
||||
%define pkgnamever %{pkgname}-%{pkgver}\
|
||||
%define basepkg %{?ghc_name}%{!?ghc_name:ghc}-%{pkgname}\
|
||||
%define docdir %{ghclibdocdir}/%{pkgnamever}\
|
||||
if [ -z "$(ls %{buildroot}%{ghclibdir}/package.conf.d/)" ]; then\
|
||||
echo "%{buildroot}%{ghclibdir}/package.conf.d/*.conf not found"\
|
||||
exit 1\
|
||||
fi\
|
||||
rm -f %{basepkg}.files %{basepkg}-devel.files\
|
||||
touch %{basepkg}.files %{basepkg}-devel.files\
|
||||
ls %{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf >> %{basepkg}-devel.files\
|
||||
pkgdir="%{ghclibdir}/%{pkgnamever}"\
|
||||
if [ -d "%{buildroot}${pkgdir}" ]; then\
|
||||
%if %{defined _ghcdynlibdir}\
|
||||
echo "${pkgdir}" >> %{basepkg}-devel.files\
|
||||
%else\
|
||||
echo "%%dir ${pkgdir}" >> %{basepkg}.files\
|
||||
find %{buildroot}${pkgdir} -mindepth 1 -type d | sed "s/^/%dir /" >> %{basepkg}-devel.files\
|
||||
find %{buildroot}${pkgdir} ! \\( -type d -o -name "libHS*.so" \\) >> %{basepkg}-devel.files\
|
||||
%endif\
|
||||
echo "%%attr(755,root,root) %{?_ghcdynlibdir}%{!?_ghcdynlibdir:${pkgdir}}/libHS%{pkgnamever}-*ghc%{ghc_version}.so" >> %{basepkg}.files\
|
||||
fi\
|
||||
if [ -d "%{buildroot}%{docdir}" ]; then\
|
||||
echo "%{docdir}" >> %{basepkg}-devel.files\
|
||||
fi\
|
||||
%if 0%{?1:1}\
|
||||
for i in $(ls %{buildroot}%{_ghclicensedir}/%{!?1:%{name}}%{?1:%{basepkg}}); do\
|
||||
echo "%%license %{?1:%{pkgnamever}/}$i" >> %{basepkg}.files\
|
||||
done\
|
||||
%endif\
|
||||
for i in %{basepkg}.files %{basepkg}-devel.files; do\
|
||||
if [ -f "$i" ]; then\
|
||||
sed -i -e "s!%{buildroot}!!g" $i\
|
||||
fi\
|
||||
done\
|
||||
%{nil}
|
||||
|
||||
# create and install package.conf file
|
||||
# cabal_pkg_conf [name] [version]
|
||||
%cabal_pkg_conf()\
|
||||
%define pkgname %{?1}%{!?1:%{pkg_name}}\
|
||||
%define pkgver %{?2}%{!?2:%{version}}\
|
||||
%define pkgnamever %{pkgname}-%{pkgver}\
|
||||
%cabal register --gen-pkg-config\
|
||||
if [ -d %{pkgnamever}.conf ]; then\
|
||||
for i in $(ls "%{pkgnamever}.conf/"); do\
|
||||
sub=$(echo $i | sed -e "s/^[0-9]\\+-//")\
|
||||
install -D --mode=0644 %{pkgnamever}.conf/${i} %{buildroot}%{ghclibdir}/package.conf.d/${sub}.conf\
|
||||
done\
|
||||
else\
|
||||
install -D --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}.conf\
|
||||
fi\
|
||||
%{nil}
|
||||
|
||||
# ghc_bin_build
|
||||
%ghc_bin_build\
|
||||
%undefine _enable_debug_packages\
|
||||
%cabal_configure\
|
||||
%cabal build %{?ghc_smp_mflags} %{?cabal_build_options}
|
||||
|
||||
# ghc_lib_build_without_haddock [name] [version]
|
||||
%ghc_lib_build_without_haddock()\
|
||||
%undefine _enable_debug_packages\
|
||||
%if 0%{?rhel} && 0%{?rhel} < 8\
|
||||
licensedirversion=%{?2:-%2}\
|
||||
%endif\
|
||||
%cabal_configure %{!?without_prof:-p} --enable-shared %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{_ghclicensedir}/ghc-%1${licensedirversion} --htmldir=%{ghclibdocdir}/%1-%2} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
|
||||
%cabal build %{?ghc_smp_mflags} %{?cabal_build_options}\
|
||||
%{nil}
|
||||
|
||||
# ghc_lib_build [name] [version]
|
||||
%ghc_lib_build()\
|
||||
%ghc_lib_build_without_haddock %{?1} %{?2}\
|
||||
%if %{undefined without_haddock}\
|
||||
%define pkgname %{?1}%{!?1:%{pkg_name}}\
|
||||
%define pkgver %{?2}%{!?2:%{version}}\
|
||||
if [ -n dist/build/libHS%{pkgname}-%{pkgver}*.so ]; then\
|
||||
%cabal haddock --html --hyperlink-source --hoogle %{?cabal_haddock_options}\
|
||||
fi\
|
||||
%endif\
|
||||
%{nil}
|
||||
|
||||
# install bin package
|
||||
%ghc_bin_install()\
|
||||
%{!?_fileattrsdir:%global _use_internal_dependency_generator 0}\
|
||||
%{!?_fileattrsdir:%global __find_requires %{_rpmconfigdir}/ghc-deps.sh %{buildroot}%{ghclibdir}}\
|
||||
%cabal_install\
|
||||
%{?ghc_subpackaging:%ghc_fix_rpath %{subpkgs}}\
|
||||
%{nil}
|
||||
|
||||
# ghc_lib_install [name] [version]
|
||||
%ghc_lib_install()\
|
||||
%{!?_fileattrsdir:%global _use_internal_dependency_generator 0}\
|
||||
%{!?_fileattrsdir:%global __find_provides %{_rpmconfigdir}/rpmdeps --provides}\
|
||||
%{!?_fileattrsdir:%global __find_requires %{_rpmconfigdir}/ghc-deps.sh %{buildroot}%{ghclibdir}}\
|
||||
%cabal_install\
|
||||
%cabal_pkg_conf %{?1} %{?2}\
|
||||
%ghc_gen_filelists %{?1} %{?2}\
|
||||
%{?ghc_subpackaging:%ghc_fix_rpath %{subpkgs}}\
|
||||
%{nil}
|
||||
|
||||
# ghc_fix_rpath lib-ver ...
|
||||
%ghc_fix_rpath()\
|
||||
%if %{undefined ghc_without_dynamic}\
|
||||
if ! type chrpath > /dev/null; then exit 1; fi\
|
||||
for i in $(find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -print); do\
|
||||
for lib in %*; do\
|
||||
if [ -x "$i" ]; then\
|
||||
rpath=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\
|
||||
case $rpath in\
|
||||
*$PWD/$lib/dist/build*)\
|
||||
case %{ghc_version} in\
|
||||
7.10.*)\
|
||||
pkgid=$(cd %{buildroot}%{ghclibdir}/package.conf.d; ls ${lib}* | sed -e "s/.conf$//")\
|
||||
syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --global --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $pkgid library-dirs) ;;\
|
||||
8.0)\
|
||||
pkgid=$(cd %{buildroot}%{ghclibdir}; echo ${lib}*)\
|
||||
syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --global --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $lib library-dirs | grep $pkgid) ;;\
|
||||
*)\
|
||||
syspath="" ;;\
|
||||
esac\
|
||||
newrpath=$(echo $rpath | sed -e "s@$PWD/$lib/dist/build@${syspath}@g" -e "s/::/:/" -e "s/^://" -e "s/:$//")\
|
||||
chrpath -r $newrpath $i\
|
||||
;;\
|
||||
esac\
|
||||
else\
|
||||
echo "%%ghc_fix_rpath: no $i executable"\
|
||||
exit 1\
|
||||
fi\
|
||||
done\
|
||||
done\
|
||||
%endif\
|
||||
%{nil}
|
||||
|
||||
# Deprecated by ghc_fix_rpath:
|
||||
# ghc_fix_dynamic_rpath prog ...
|
||||
%ghc_fix_dynamic_rpath()\
|
||||
%if %{undefined ghc_without_dynamic}\
|
||||
if ! type chrpath > /dev/null; then exit 1; fi\
|
||||
pdir=$(pwd)\
|
||||
for i in %*; do\
|
||||
case $i in\
|
||||
/*) prog=%{buildroot}$i ;;\
|
||||
*) prog=%{buildroot}%{_bindir}/$i ;;\
|
||||
esac\
|
||||
if [ -x "$prog" ]; then\
|
||||
rpath=$(chrpath $prog | sed -e "s@^$prog: R.*PATH=@@")\
|
||||
case $rpath in\
|
||||
*$pdir*)\
|
||||
newrpath=$(echo $rpath | sed -e "s@$pdir/dist/build@%{ghclibdir}/%{pkg_name}-%{version}@g")\
|
||||
chrpath -r $newrpath $prog\
|
||||
;;\
|
||||
esac\
|
||||
else\
|
||||
echo "%%ghc_fix_dynamic_rpath: no such file $prog"\
|
||||
exit 1\
|
||||
fi\
|
||||
done\
|
||||
%endif\
|
||||
%{nil}
|
||||
|
||||
%ghc_pkg_recache %{_bindir}/ghc-pkg-%{ghc_version} recache --no-user-package-db || :
|
||||
|
||||
# deprecated
|
||||
%ghc_bootstrap\
|
||||
%global without_prof 1\
|
||||
%global without_haddock 1\
|
||||
%global without_manual 1
|
||||
|
||||
# skip prof libs and documentation
|
||||
%ghc_quick_build\
|
||||
%global without_prof 1\
|
||||
%global without_haddock 1
|
100
macros.ghc-extra
Normal file
100
macros.ghc-extra
Normal file
@ -0,0 +1,100 @@
|
||||
# RPM Macros for packaging Haskell packages with multiple libs -*-rpm-spec-*-
|
||||
|
||||
# ghc_lib_subpackage [-c cdepslist] [-d] [-l licensetag] [-x] [name-version]
|
||||
# for backward compat also support: ghc_lib_subpackage name version
|
||||
%ghc_lib_subpackage(c:dl:x)\
|
||||
%define pkgname %{?2:%{1}}%{!?2:%{lua:\
|
||||
local pv = rpm.expand("%1")\
|
||||
local _, _, name = string.find(pv, "^([%a%d-]+)-")\
|
||||
print(name)\
|
||||
}}\
|
||||
%define pkgver %{?2}%{!?2:%{lua:\
|
||||
local pv = rpm.expand("%1")\
|
||||
print(string.sub(pv, string.find(pv, "[%d.]+$")))\
|
||||
}}\
|
||||
%{!-x:%{?1:%global ghc_packages_list %{?ghc_packages_list} %{pkgname}-%{pkgver}}}\
|
||||
%define ghc_prefix %{?ghc_name}%{!?ghc_name:ghc}\
|
||||
%define basepkg %{ghc_prefix}-%{pkgname}\
|
||||
%package -n %{basepkg}\
|
||||
Summary: Haskell %{pkgname} library\
|
||||
%if 0%{?rhel} && 0%{?rhel} < 6\
|
||||
Group: System/Libraries\
|
||||
%endif\
|
||||
%{?1:Version: %{pkgver}}\
|
||||
%{-l:License: %{-l*}}\
|
||||
Url: http://hackage.haskell.org/package/%{pkgname}\
|
||||
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(%{ghc_prefix}-[^, ]*\\)-devel/\\1/g")}\
|
||||
\
|
||||
%description -n %{basepkg}\
|
||||
This package provides the Haskell %{pkgname} library.\
|
||||
\
|
||||
%package -n %{basepkg}-devel\
|
||||
Summary: Haskell %{pkgname} library development files\
|
||||
%if 0%{?rhel} && 0%{?rhel} < 6\
|
||||
Group: Development/Languages/Other\
|
||||
%endif\
|
||||
%{?1:Version: %{pkgver}}\
|
||||
%{-l:License: %{-l*}}\
|
||||
Requires(post): %{ghc_prefix}-compiler = %{ghc_version}\
|
||||
Requires(postun): %{ghc_prefix}-compiler = %{ghc_version}\
|
||||
Requires: %{ghc_prefix}-%{pkgname}%{?_isa} = %{pkgver}-%{release}\
|
||||
%{?ghc_pkg_c_deps:Requires: %{ghc_pkg_c_deps}}\
|
||||
%{-c:Requires: %{-c*}}\
|
||||
%{?ghc_pkg_obsoletes:Obsoletes: %{ghc_pkg_obsoletes}}\
|
||||
\
|
||||
%description -n %{basepkg}-devel\
|
||||
This package provides the Haskell %{pkgname} library development files.\
|
||||
\
|
||||
%post -n %{basepkg}-devel\
|
||||
%ghc_pkg_recache\
|
||||
\
|
||||
%postun -n %{basepkg}-devel\
|
||||
%ghc_pkg_recache\
|
||||
\
|
||||
%files -n %{basepkg} -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}.files\
|
||||
%if 0%{?rhel} && 0%{?rhel} < 6\
|
||||
%defattr(-,root,root,-)\
|
||||
%endif\
|
||||
%{?base_doc_files:%doc %base_doc_files}\
|
||||
\
|
||||
%files -n %{basepkg}-devel -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-devel.files\
|
||||
%if 0%{?rhel} && 0%{?rhel} < 6\
|
||||
%defattr(-,root,root,-)\
|
||||
%endif\
|
||||
%{?devel_doc_files:%doc %devel_doc_files}\
|
||||
%{nil}
|
||||
|
||||
# ghc_libs_build [name-version] ...
|
||||
%ghc_libs_build()\
|
||||
HOME=$PWD\
|
||||
%global ghc_subpackaging 1\
|
||||
for i in %*; do\
|
||||
name=$(echo $i | sed -e "s/\\(.*\\)-.*/\\1/")\
|
||||
ver=$(echo $i | sed -e "s/.*-\\(.*\\)/\\1/")\
|
||||
cd $name-$ver\
|
||||
case $name in\
|
||||
haskell-platform)\
|
||||
%ghc_lib_build_without_haddock $name $ver\
|
||||
;;\
|
||||
*)\
|
||||
%ghc_lib_build $name $ver\
|
||||
./Setup register --inplace\
|
||||
;;\
|
||||
esac\
|
||||
cd ..\
|
||||
done\
|
||||
%{nil}
|
||||
|
||||
# ghc_libs_install [name-version] ...
|
||||
%ghc_libs_install()\
|
||||
HOME=$PWD\
|
||||
args="%*"\
|
||||
for i in $args; do\
|
||||
cd $i\
|
||||
name=$(echo $i | sed -e "s/\\(.*\\)-.*/\\1/")\
|
||||
ver=$(echo $i | sed -e "s/.*-\\(.*\\)/\\1/")\
|
||||
%ghc_lib_install $name $ver\
|
||||
cd ..\
|
||||
done\
|
||||
%ghc_fix_rpath $args\
|
||||
%{nil}
|
9
macros.ghc-os
Normal file
9
macros.ghc-os
Normal file
@ -0,0 +1,9 @@
|
||||
# OS specific settings
|
||||
|
||||
%_ghcdocdir %{_ghclicensedir}/%{name}
|
||||
|
||||
%_ghcdynlibdir %{_libdir}
|
||||
|
||||
%ghc_without_dynamic 1
|
||||
|
||||
%cabal_install_options -v
|
77
tests/test-rebuild.sh
Executable file
77
tests/test-rebuild.sh
Executable file
@ -0,0 +1,77 @@
|
||||
#!/bin/sh
|
||||
|
||||
# for testing updates to ghc-rpm-macros etc
|
||||
# In a pkg dir run
|
||||
# $ ./test-rebuild.sh
|
||||
# or clone a pkg branch:
|
||||
# $ ./test-rebuild.sh [pkg]
|
||||
|
||||
set -e
|
||||
|
||||
PKG=${1:-$(fedpkg gimmespec | sed -e "s/.spec//")}
|
||||
|
||||
[ -d "$PKG" -o -f "$PKG.spec" ] || fedpkg clone -a $PKG
|
||||
|
||||
[ -d "$PKG" ] && cd $PKG
|
||||
|
||||
ARCH=$(arch)
|
||||
|
||||
#if [ -d $ARCH ]; then
|
||||
# echo Please move existing $ARCH/
|
||||
# exit 1
|
||||
#fi
|
||||
|
||||
if [ -f /etc/os-release ]; then
|
||||
eval $(grep VERSION_ID /etc/os-release)
|
||||
if git branch -a | grep -q f$VERSION_ID; then
|
||||
BRANCH=f$VERSION_ID
|
||||
else
|
||||
case $VERSION_ID in
|
||||
7.*) BRANCH=epel7 ;;
|
||||
*) BRANCH=master ;;
|
||||
esac
|
||||
fi
|
||||
else
|
||||
# assume RHEL6
|
||||
BRANCH=el6
|
||||
fi
|
||||
|
||||
if [ "* $BRANCH" != "$(git branch | grep '^*')" ]; then
|
||||
fedpkg switch-branch $BRANCH
|
||||
fi
|
||||
|
||||
if [ "* $BRANCH" != "$(git branch | grep '^*')" ]; then
|
||||
echo "Git branch does not match Fedora installation!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git pull
|
||||
|
||||
if [ "$UID" != "0" ]; then
|
||||
SUDO="sudo"
|
||||
else
|
||||
SUDO=""
|
||||
fi
|
||||
|
||||
echo Running dnf builddep:
|
||||
$SUDO dnf builddep $PKG.spec
|
||||
|
||||
fedpkg local
|
||||
|
||||
VERREL=$(fedpkg verrel | sed -e "s/^$PKG-//")
|
||||
|
||||
TMP=test-tmp
|
||||
|
||||
mkdir -p $TMP/
|
||||
|
||||
PKGS=$(cd $ARCH; rpm -qp $(ls *-$VERREL*.rpm))
|
||||
|
||||
for i in $PKGS; do
|
||||
# FIXME: should check NVR is same before building
|
||||
rpm -q --quiet $i || $SUDO dnf install -q $i
|
||||
for k in list requires provides scripts; do
|
||||
rpm -qp --$k $ARCH/$i.rpm | grep -v rpmlib > $TMP/$i.$k.test || :
|
||||
rpm -q --$k $i | grep -v rpmlib > $TMP/$i.$k.installed || :
|
||||
diff -u $TMP/$i.$k.installed $TMP/$i.$k.test -I /usr/lib/.build-id || :
|
||||
done
|
||||
done
|
Loading…
Reference in New Issue
Block a user