fmartingr
/
shelfzilla
Archived
1
0
Fork 0
This repository has been archived on 2021-06-29. You can view files and clone it, but cannot push or open issues or pull requests.
shelfzilla/rpm/spec/shelfzilla.spec

104 lines
3.3 KiB
RPMSpec
Raw Normal View History

2014-04-04 16:12:34 +00:00
Summary: Shelfzilla
2014-04-08 23:37:19 +00:00
Name: shelfzilla
2014-04-03 20:29:07 +00:00
Version: %{_gs_version}
Release: %{_gs_revision}
BuildRoot: %{_topdir}/BUILD/%{name}
2014-04-08 23:25:40 +00:00
BuildArch: x86_64
2014-04-04 16:12:34 +00:00
Provides: shelfzilla
Requires: python27
2014-04-04 16:39:53 +00:00
License: Comercial
2014-04-04 16:12:34 +00:00
Group: FDB
Distribution: FDB Global Services
2014-08-25 15:10:09 +00:00
Vendor: FDB
2014-04-03 20:29:07 +00:00
%description
2014-04-04 16:12:34 +00:00
Shelfzilla is a website which save all your Manga
2014-04-03 20:29:07 +00:00
2014-04-08 23:25:40 +00:00
%define _app_dir /opt/shelfzilla
2014-04-28 12:20:59 +00:00
%define _init_path /etc/init.d
2014-04-03 20:29:07 +00:00
%define _binaries_in_noarch_packages_terminate_build 0
# Do not check unpackaged files
%undefine __check_files
# -------------------------------------------------------------------------------------------- #
# prep section:
# -------------------------------------------------------------------------------------------- #
# Remove previous build files
%prep
rm -rf $RPM_BUILD_ROOT*
2014-04-04 16:39:53 +00:00
# clean up development-only files
find %{_gitdir} -depth -name .git -exec rm -rf {} \;
2014-04-03 20:29:07 +00:00
# -------------------------------------------------------------------------------------------- #
# install section:
# -------------------------------------------------------------------------------------------- #
%install
2014-04-08 23:32:43 +00:00
# Make structure
[ -d $RPM_BUILD_ROOT%{_app_dir} ] || mkdir -p $RPM_BUILD_ROOT%{_app_dir}
[ -d $RPM_BUILD_ROOT%{_app_dir}/config ] || mkdir -p $RPM_BUILD_ROOT%{_app_dir}/config
2015-05-25 17:33:46 +00:00
echo $RPM_BUILD_ROOT%{_init_path}
2015-05-25 17:30:30 +00:00
[ -d $RPM_BUILD_ROOT%{_init_path} ] || mkdir -p $RPM_BUILD_ROOT%{_init_path}
2014-04-08 23:32:43 +00:00
2014-04-03 20:29:07 +00:00
# Copy Source Code
2014-04-04 16:39:53 +00:00
cp -r %{_gitdir}/shelfzilla $RPM_BUILD_ROOT%{_app_dir}
cp -r %{_gitdir}/config/production $RPM_BUILD_ROOT%{_app_dir}/config
cp -r %{_gitdir}/config/requirements.txt $RPM_BUILD_ROOT%{_app_dir}/config
cp -r %{_gitdir}/*.json $RPM_BUILD_ROOT%{_app_dir}/
cp -r %{_gitdir}/*.py $RPM_BUILD_ROOT%{_app_dir}/
2014-08-25 15:25:15 +00:00
cp -f %{_gitdir}/.bowerrc $RPM_BUILD_ROOT%{_app_dir}/
2014-04-04 16:39:53 +00:00
cp -r %{_gitdir}/gruntfile.coffee $RPM_BUILD_ROOT%{_app_dir}/
2015-05-25 17:30:30 +00:00
cp -r %{_gitdir}/rpm/scripts/shelfzilla $RPM_BUILD_ROOT%{_init_path}
2014-04-04 16:39:53 +00:00
2014-04-03 20:29:07 +00:00
# -------------------------------------------------------------------------------------------- #
# post-install section:
# -------------------------------------------------------------------------------------------- #
%post
2015-05-25 17:48:40 +00:00
## Modify Init Script
chmod 775 %{_init_path}/shelfzilla
chkconfig --add shelfzilla
chkconfig shelfzilla on
2014-04-04 16:12:34 +00:00
## Npm install
2015-01-31 14:12:15 +00:00
cd %{_app_dir} && npm install --production
2014-04-04 16:12:34 +00:00
2014-04-04 16:39:53 +00:00
## pip install
2015-01-31 14:12:15 +00:00
pip install -r %{_app_dir}/config/production/requirements.txt
2014-04-04 16:12:34 +00:00
2014-04-04 16:39:53 +00:00
## Migrate
2015-01-31 14:12:15 +00:00
python2.7 %{_app_dir}/manage.py migrate --no-initial-data
2014-04-04 16:12:34 +00:00
2014-04-22 22:32:53 +00:00
## Bower
2015-01-31 14:12:15 +00:00
cd %{_app_dir}
bower install --allow-root
2014-04-22 22:32:53 +00:00
2014-04-04 16:39:53 +00:00
## Collect static
2015-01-31 14:12:15 +00:00
python2.7 manage.py collectstatic --clear --noinput
2014-04-03 20:29:07 +00:00
# -------------------------------------------------------------------------------------------- #
# pre-uninstall section:
# -------------------------------------------------------------------------------------------- #
%preun
2014-04-28 12:20:59 +00:00
if [ $1 == 0 ]; then
echo "Cleaning application files"
[ -e /etc/logrotate.d/shelzilla ] && rm -fv /etc/logrotate.d/shelfzilla
2014-11-08 11:21:55 +00:00
[ -e %{_init_path}/shelfzilla ] && rm -fv %{_init_path}/shelfzilla
2014-04-28 12:20:59 +00:00
echo "Uninstall finished"
fi
2014-04-03 20:29:07 +00:00
# -------------------------------------------------------------------------------------------- #
# post-uninstall section:
# -------------------------------------------------------------------------------------------- #
%postun
%clean
2015-05-25 17:45:46 +00:00
rm -rf $RPM_BUILD_ROOT
2014-04-03 20:29:07 +00:00
%files
%{_app_dir}/*
2014-08-25 15:27:23 +00:00
%{_app_dir}/.bowerrc
2015-05-25 17:51:36 +00:00
%attr(755, root, root) %{_init_path}/shelfzilla