Add .rpm package generation script

This commit is contained in:
Mayank Gupta 2017-04-15 22:49:13 +05:30
parent fdd5b6bf9d
commit f2755ae5bb
5 changed files with 82 additions and 0 deletions

3
.gitignore vendored
View File

@ -95,3 +95,6 @@ src/zvbi/.dirstamp
# Arch # Arch
package_creators/*.pkg.tar.xz package_creators/*.pkg.tar.xz
#RPMs
package_creators/*.rpm

View File

@ -99,6 +99,16 @@ More usage information can be found on our website:
cd ccextractor/package_creators cd ccextractor/package_creators
./arch.sh ./arch.sh
### Redhat Package Manager (rpm) based Linux Distributions
# make sure you have CCExtractor repository forked
# clone repository
# install git via source
git clone https://github.com/%USERNAME%/ccextractor.git # paste your github username
# building installation package (.rpm)
cd ccextractor/package_creators
./rpm.sh
### Windows ### Windows
Open the windows/ccextractor.sln file with Visual Studio (2015 at least), and build it. Configurations "(Debug|Release)-Full" includes dependent libraries which are used for OCR. Open the windows/ccextractor.sln file with Visual Studio (2015 at least), and build it. Configurations "(Debug|Release)-Full" includes dependent libraries which are used for OCR.

View File

@ -2,7 +2,10 @@
----------------- -----------------
- Fix: Prevent the OCR being initialized more than once (happened on multiprogram and - Fix: Prevent the OCR being initialized more than once (happened on multiprogram and
PAT changes) PAT changes)
- New: Added .rpm package generation script.
- New: Added build/installation script for .pkg.tar.xz (Arch Linux). - New: Added build/installation script for .pkg.tar.xz (Arch Linux).
- New: Added tarball generation script.
- New: Added Autoconf build scripts for CCExtractor to generate makefiles.
0.85b (2017-1-26) 0.85b (2017-1-26)

View File

@ -0,0 +1,36 @@
Name: ccextractor
Version: 0.85
Release: 1
Summary: A closed captions and teletext subtitles extractor for video streams.
Group: Applications/Internet
License: GPL
URL: http://ccextractor.org/
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
CCExtractor is a software that extracts closed captions from videos of various formats, even live video streams. Available as a multi-platform desktop application.
%global debug_package %{nil}
%prep
%setup -q
%build
./configure --enable-ocr --prefix="$pkgdir/usr/local"
make
%install
mkdir -p $RPM_BUILD_ROOT/usr/local/bin
install ccextractor $RPM_BUILD_ROOT/usr/local/bin/ccextractor
%files
%defattr(-,root,root)
/usr/local/bin/ccextractor
%clean
rm -rf $RPM_BUILD_ROOT
%changelog
* Fri Apr 14 2017 Carlos Fernandez <carlos@ccextractor.org>
- Initial build

30
package_creators/rpm.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
if [[ $(rpmbuild 2>&1) == *"not found"* ]]
then
echo "ERROR: 'rpmbuild' package not found. Please install it and try again."
exit 0
fi
workdir=`pwd`
echo "%_topdir $workdir/RPMBUILD" >> $HOME/.rpmmacros
./tarball.sh
retval=$?
if [ $retval -ne 0 ]; then
echo "Sorry, the package could not be created as the tarball building process failed with return code $retval"
rm -f ./*.tar.gz
exit $retval
fi
mkdir -p RPMBUILD/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
mv *.tar.gz RPMBUILD/SOURCES/
cp ccextractor.spec RPMBUILD/SPECS
cd RPMBUILD/SPECS
rpmbuild -ba ccextractor.spec
retval=$?
if [ $retval -ne 0 ]; then
echo "Sorry, the package could not be created as rpmbuild failed with return code $retval"
exit $retval
fi
cd ../..
cp RPMBUILD/RPMS/x86_64/*.rpm .
rm -rf RPMBUILD