Skip to content

Commit

Permalink
New: script testing in rpmbuild, spec cleaning
Browse files Browse the repository at this point in the history
Signed-off-by: Miroslav Safr <Miroslav.Safr@gmail.com>
  • Loading branch information
safrm committed Jan 13, 2014
1 parent 5614065 commit b85d990
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions xmlenv.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
%define buildroot %{_topdir}/%{name}-%{version}-root
%define APP_BUILD_DATE %(date +'%%Y%%m%%d_%%H%%M')

Name: xmlenv
Expand All @@ -13,47 +12,39 @@ Vendor: Miroslav Safr <miroslav.safr@gmail.com>
Source0: %{name}-%{version}.tar.bz2
Autoreq: on
Autoreqprov: on
BuildRoot: %{buildroot}

%description
multiplatformal/distribution system dumping and comparation

%prep
%setup -c -n ./%{name}-%{version}
# >> setup
# << setup

%build
# >> build pre
#qmake install_prefix=/usr
# << build pre
#make %{?jobs:-j%jobs}

# >> build post
# << build post

%install
rm -fr $RPM_BUILD_ROOT
# >> install pre
export INSTALL_ROOT=$RPM_BUILD_ROOT
# << install pre
#make install
rm -fr %{buildroot}
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}/xmlenv
install -m 755 ./xmlenv %{buildroot}/usr/bin/
sed -i".bkp" "1,/^VERSION=/s/^VERSION=.*/VERSION=%{version}/" %{buildroot}%{_bindir}/xmlenv && rm -f %{buildroot}%{_bindir}/xmlenv.bkp
sed -i".bkp" "1,/^VERSION_DATE=/s/^VERSION_DATE=.*/VERSION_DATE=%{APP_BUILD_DATE}/" %{buildroot}%{_bindir}/xmlenv && rm -f %{buildroot}%{_bindir}/xmlenv.bkp
install -m 755 ./compare-pkgs.xsl %{buildroot}%{_datadir}/xmlenv/
sed -i".bkp" "1,/Version: /s/Version: */Version: %{version} %{APP_BUILD_DATE}/" %{buildroot}%{_datadir}/xmlenv/compare-pkgs.xsl && rm -f %{buildroot}%{_datadir}/xmlenv/compare-pkgs.xsl.bkp
# >> install post
# << install post

%check
for TEST in $( grep -r -l -h "#\!/bin/sh" . )
do
sh -n $TEST
if [ $? != 0 ]; then
echo "syntax error in $TEST, exiting.."
exit 1
fi
done

%files
%defattr(-,root,root,-)
# >> files
%{_bindir}/xmlenv
%dir %{_datadir}/xmlenv
%{_datadir}/xmlenv/compare-pkgs.xsl
# << files


0 comments on commit b85d990

Please sign in to comment.