replace %cabal_tweak_dep_ver with cabal-tweak-dep-ver script
rpmbuild doesn't handle spaces in quoted args
This commit is contained in:
parent
bab627bc22
commit
7cdea6ff7e
22
cabal-tweak-dep-ver
Executable file
22
cabal-tweak-dep-ver
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
USAGE="Usage: $0 dep old new"
|
||||||
|
|
||||||
|
if [ $# -ne 3 ]; then
|
||||||
|
echo "$USAGE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
CABALFILE=*.cabal
|
||||||
|
|
||||||
|
if [ $(ls $CABALFILE | wc -l) -ne 1 ]; then
|
||||||
|
echo "There needs to be one .cabal file in the current dir!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! grep -q "$1.*$2" $CABALFILE; then
|
||||||
|
echo "$CABALFILE does not match: $1 $2"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
sed -i.$1 -e "s/\($1.*\)$2/\1$3/g" $CABALFILE
|
@ -18,14 +18,6 @@ proceeding, to avoid dependency ABI breakage from a future ghc rebuild."\
|
|||||||
%endif\
|
%endif\
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# tweak depends versions
|
|
||||||
# cabal_tweak_dep_ver dep old new [backup]
|
|
||||||
%cabal_tweak_dep_ver()\
|
|
||||||
if ! grep -q "%1[ >=].*%2"; then\
|
|
||||||
exit 1\
|
|
||||||
fi\
|
|
||||||
sed -i.%{?3}%1 -e "s/\(%1[ >=].*\)%2/\1%3/g" %{pkg_name}-%{version}/%{pkg_name}.cabal
|
|
||||||
|
|
||||||
# configure
|
# configure
|
||||||
%cabal_configure\
|
%cabal_configure\
|
||||||
%ghc_check_bootstrap\
|
%ghc_check_bootstrap\
|
||||||
|
@ -19,6 +19,7 @@ Source0: ghc-rpm-macros.ghc
|
|||||||
Source1: COPYING
|
Source1: COPYING
|
||||||
Source2: AUTHORS
|
Source2: AUTHORS
|
||||||
Source3: ghc-deps.sh
|
Source3: ghc-deps.sh
|
||||||
|
Source4: cabal-tweak-dep-ver
|
||||||
Requires: redhat-rpm-config
|
Requires: redhat-rpm-config
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -41,6 +42,8 @@ install -p -D -m 0644 %{SOURCE0} ${RPM_BUILD_ROOT}/%{macros_file}
|
|||||||
|
|
||||||
install -p -D -m 0755 %{SOURCE3} %{buildroot}/%{_prefix}/lib/rpm/ghc-deps.sh
|
install -p -D -m 0755 %{SOURCE3} %{buildroot}/%{_prefix}/lib/rpm/ghc-deps.sh
|
||||||
|
|
||||||
|
install -p -D -m 0755 %{SOURCE4} %{buildroot}/%{_bindir}/cabal-tweak-dep-ver
|
||||||
|
|
||||||
# this is why this package is now arch-dependent:
|
# this is why this package is now arch-dependent:
|
||||||
# turn off shared libs and dynamic linking on secondary archs
|
# turn off shared libs and dynamic linking on secondary archs
|
||||||
%ifnarch %{ix86} x86_64
|
%ifnarch %{ix86} x86_64
|
||||||
@ -57,11 +60,12 @@ EOF
|
|||||||
%doc COPYING AUTHORS
|
%doc COPYING AUTHORS
|
||||||
%config(noreplace) %{macros_file}
|
%config(noreplace) %{macros_file}
|
||||||
%{_prefix}/lib/rpm/ghc-deps.sh
|
%{_prefix}/lib/rpm/ghc-deps.sh
|
||||||
|
%{_bindir}/cabal-tweak-dep-ver
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Fri Jun 22 2012 Jens Petersen <petersen@redhat.com> - 0.95.4-1
|
* Fri Jun 22 2012 Jens Petersen <petersen@redhat.com> - 0.95.4-1
|
||||||
- add cabal_tweak_dep_ver macro to tweak a depend's version bound in .cabal
|
- new cabal-tweak-dep-ver script to tweak depends version bounds in .cabal
|
||||||
|
|
||||||
* Sat Jun 9 2012 Jens Petersen <petersen@redhat.com> - 0.95.3-1
|
* Sat Jun 9 2012 Jens Petersen <petersen@redhat.com> - 0.95.3-1
|
||||||
- ghc-dep.sh: only use buildroot package.conf.d if it exists
|
- ghc-dep.sh: only use buildroot package.conf.d if it exists
|
||||||
|
Loading…
Reference in New Issue
Block a user