Blame mcomix3.spec

65967e4
%global		gitcommit		cff5fc3e8214e56b112e6469e544fa7b97690aa4
65967e4
%global		gitdate		20210916
b25042f
%global		shortcommit	%(c=%{gitcommit}; echo ${c:0:7})
b25042f
65967e4
%global		tarballdate	20210923
65967e4
%global		tarballtime	1342
b25042f
481bf70
%global		base_summary 	User-friendly, customizable image viewer for comic books
481bf70
481bf70
%global		base_description \
481bf70
MComix3 is a user-friendly, customizable image viewer. \
481bf70
It has been forked from the original MComix project and ported to python3.
481bf70
481bf70
b25042f
Name:			mcomix3
b25042f
# For now, choose version 0
b25042f
Version:		0
65967e4
Release:		0.21.D%{gitdate}git%{shortcommit}%{?dist}
481bf70
Summary:		%base_summary
b25042f
# GPL version info is from mcomix/mcomixstarter.py
b25042f
License:		GPLv2+
b25042f
URL:			https://github.com/multiSnow/mcomix3
b25042f
# Use git repository directly - with it when modifying source
b25042f
# we can do it *in git repository* and then we can directly submit
b25042f
# patch to the upstream by pull request
b25042f
Source0:		%{name}-%{tarballdate}T%{tarballtime}.tar.bz2
b25042f
# Source0 is created by Source1
b25042f
Source1:		create-mcomix3-git-bare-tarball.sh
b25042f
# Some additional files
064bcb9
Source2:		mcomix3starter.sh.in
b25042f
# Patches
b25042f
Patch2:		0002-Change-domain-name-for-gettext.patch
b25042f
Patch3:		0003-Search-gettext-files-in-system-wide-directory.patch
b25042f
b25042f
BuildRequires:	python3-devel
b89be89
BuildRequires:	%{_bindir}/appstream-util
b25042f
BuildRequires:	%{_bindir}/desktop-file-install
b25042f
BuildRequires:	gettext
b25042f
BuildRequires:	git
b25042f
BuildArch:		noarch
481bf70
Requires:		%{name}-base = %{version}-%{release}
481bf70
Requires:		%{name}-thumbnailer = %{version}-%{release}
f8988ca
b25042f
Obsoletes:		mcomix < 1.2.2
b25042f
Obsoletes:		comix < 4.0.5
1705e00
Provides:		mcomix = 1.2.2
b25042f
b25042f
b25042f
%description
481bf70
%base_description
481bf70
481bf70
%package	base
481bf70
Summary:	%base_summary
481bf70
Requires:		gtk3
481bf70
Requires:		python3-gobject
481bf70
Requires:		python3-pillow
481bf70
481bf70
%description	base
481bf70
%base_description
481bf70
This package contains base executable %{name} script.
481bf70
481bf70
%package	thumbnailer
481bf70
Summary:	Thumbnailer for %{name}
481bf70
Requires:	%{name}-base = %{version}-%{release}
481bf70
481bf70
%description	thumbnailer
481bf70
This package contains thumbnailer for %{name}.
b25042f
b25042f
%prep
b25042f
%setup -q -c -T -a 0
b25042f
b25042f
# Setup source git repository
b25042f
git clone ./%{name}.git
b25042f
cd %{name}
b25042f
b25042f
git config user.name "%{name} Fedora maintainer"
b25042f
git config user.email "%{name}-owner@fedoraproject.org"
b25042f
git checkout -b %{version}-%{release}-fedora %{gitcommit}
b25042f
b25042f
# Apply patches
b25042f
cat %{PATCH2} | git am
b25042f
cat %{PATCH3} | git am
b25042f
b25042f
%build
b25042f
pushd %{name}
b25042f
rm -rf localroot
b25042f
mkdir localroot
b25042f
b25042f
python3 installer.py --srcdir=mcomix --target=$(pwd)/localroot/
b89be89
b89be89
# mime
b89be89
pushd mime
b89be89
cat mcomix.appdata.xml | \
b89be89
	sed -e 's|omix|omix3|' | sed -e 's|/mcomix3/|/mcomix/|' \
b89be89
	> %{name}.appdata.xml
b89be89
cat mcomix.desktop | sed -e 's|omix|omix3|' > %{name}.desktop
b89be89
popd
b89be89
b89be89
# man
b89be89
pushd man
b89be89
cat mcomix.1 | sed -e 's|omix|omix3|' > %{name}.1
b89be89
popd
b89be89
b25042f
popd
b25042f
064bcb9
# starter script
064bcb9
cat %SOURCE2 | sed -e 's|@python3_sitelib@|%python3_sitelib|g' > mcomix3starter.sh
064bcb9
# create starter script for comicthumb
064bcb9
cat mcomix3starter.sh | sed -e 's|mcomixstarter|comicthumb|' > comicthumbstarter.sh
064bcb9
b25042f
%install
064bcb9
BUILDTOPDIR=$(pwd)
064bcb9
b25042f
pushd %{name}
b25042f
cp -p [A-Z]* ..
b89be89
popd # from %%name
b25042f
b25042f
# Install manually...
b25042f
SITETOPDIR=%{python3_sitelib}/%{name}
b25042f
DSTTOPDIR=%{buildroot}${SITETOPDIR}
b25042f
mkdir -p ${DSTTOPDIR}
b25042f
mkdir -p ${DSTTOPDIR}/mcomix3
b25042f
mkdir -p %{buildroot}%{_datadir}/locale
b25042f
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/
b25042f
b25042f
pushd %{name}
b25042f
rm -rf localroot.2
b25042f
cp -a localroot localroot.2
b25042f
b25042f
pushd localroot.2/mcomix
b25042f
b25042f
# Wrapper script
064bcb9
install -cpm 0755 ${BUILDTOPDIR}/mcomix3starter.sh ${DSTTOPDIR}
064bcb9
install -cpm 0755 ${BUILDTOPDIR}/comicthumbstarter.sh ${DSTTOPDIR}
b25042f
# locale files
b25042f
find mcomix/messages/* -type f | while read f
b25042f
do
b25042f
	dir=$(dirname $f)
b25042f
	mv $f $dir/%{name}.mo
b25042f
done
b25042f
mv mcomix/messages/* %{buildroot}%{_datadir}/locale/
b89be89
b25042f
# duplicate icon
b25042f
for dir in mcomix/images/*x*/
b25042f
do
b25042f
	basedir=$(basename $dir)
b25042f
	mkdir -p %{buildroot}%{_datadir}/icons/hicolor/$basedir/apps
b25042f
	cp -p $dir/*png %{buildroot}%{_datadir}/icons/hicolor/$basedir/apps/%{name}.png
b25042f
done
b89be89
b89be89
# scripts
b89be89
mv comicthumb.py ${DSTTOPDIR}/
b89be89
mv mcomixstarter.py ${DSTTOPDIR}/
b89be89
b25042f
# data files
b25042f
mv mcomix/ ${DSTTOPDIR}/mcomix3/
b25042f
b25042f
# Ensure that all files are installed
b89be89
popd # from localroot.2/mcomix
b25042f
rmdir localroot.2/mcomix
b25042f
rmdir localroot.2
b25042f
b89be89
popd # from %%name
b25042f
# Wrapper symlink
b25042f
mkdir %{buildroot}/%{_bindir}
f8988ca
ln -sf ../../${SITETOPDIR}/mcomix3starter.sh %{buildroot}%{_bindir}/mcomix3
064bcb9
ln -sf ../../${SITETOPDIR}/comicthumbstarter.sh %{buildroot}%{_bindir}/comicthumb
b89be89
b89be89
pushd %{name}
b89be89
# mime data
b89be89
pushd mime
b89be89
install -D -cpm 0644 comicthumb.thumbnailer %{buildroot}%{_datadir}/thumbnailers/comicthumb.thumbnailer
b89be89
install -D -cpm 0644 %{name}.appdata.xml  %{buildroot}%{_metainfodir}/%{name}.appdata.xml
b89be89
b89be89
## desktop file
b89be89
mkdir -p %{buildroot}%{_datadir}/applications
b25042f
desktop-file-install \
b25042f
	--remove-category Application \
b25042f
	--dir %{buildroot}%{_datadir}/applications/ \
b89be89
	./%{name}.desktop
b89be89
b89be89
## Not installing mimetype icon files for now
b89be89
popd # from mime
b89be89
b89be89
# man
b89be89
pushd man
b89be89
mkdir -p %{buildroot}%{_mandir}/man1
b89be89
install -cpm 0644 \
b89be89
	comicthumb.1 \
b89be89
	%{name}.1 \
b89be89
	%{buildroot}%{_mandir}/man1/
b89be89
popd # from man
b89be89
b89be89
popd # from %%name
b25042f
b25042f
%find_lang %{name}
b25042f
b89be89
%check
b89be89
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}.appdata.xml
b89be89
481bf70
%files
b89be89
481bf70
%files	base -f %{name}.lang
b25042f
%license	COPYING
b25042f
%doc		ChangeLog
b25042f
%doc		README*
b25042f
%doc		TODO
b25042f
b25042f
%{_bindir}/%{name}
b89be89
b25042f
%{python3_sitelib}/%{name}/
b89be89
b25042f
# Do not own %%{_datadir}/icons/hicolor explicitly
b25042f
%{_datadir}/icons/hicolor/*/apps/%{name}.png
b89be89
b89be89
%{_metainfodir}/%{name}.appdata.xml
b25042f
%{_datadir}/applications/%{name}.desktop
b89be89
b89be89
%{_mandir}/man1/%{name}.1*
481bf70
481bf70
%files	thumbnailer
481bf70
%{_bindir}/comicthumb
481bf70
%{_datadir}/thumbnailers/comicthumb.thumbnailer
b89be89
%{_mandir}/man1/comicthumb.1*
b89be89
b25042f
b25042f
%changelog
65967e4
* Thu Sep 23 2021 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0-0.21.D20210916gitcff5fc3
65967e4
- Update to the latest git
65967e4
4ac1755
* Sun Sep 12 2021 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0-0.20.D20210829git8cd3ebe
4ac1755
- Update to the latest git
481bf70
- Split whole package into -base and -thumbnailer (ref: bug 1965831)
4ac1755
7d81fab
* Tue Aug 10 2021 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0-0.19.D20210803gitd003e64
7d81fab
- Update to the latest git
7d81fab
a041f78
* Fri Jul 30 2021 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0-0.18.D20210526git9eb4fc7
a041f78
- Update to the latest git
a041f78
609f1ac
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.17.D20210507gitaf858a6
609f1ac
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
609f1ac
984ae9a
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0-0.16.D20210507gitaf858a6
984ae9a
- Rebuilt for Python 3.10
984ae9a
1b4266e
* Fri May  7 2021 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0-0.15.D20210507gitaf858a6
1b4266e
- Update to the latest git
1b4266e
ce574bb
* Sat May  1 2021 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0-0.14.D20210423git139344e
ce574bb
- Update to the latest git
ce574bb
715d42c
* Thu Apr  1 2021 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0-0.13.D20210329git523f08f
715d42c
- Update to the latest git
715d42c
715d42c
* Sun Mar 28 2021 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0-0.12.D20210321gitdfe9520
064bcb9
- Apply bug 1941827 suggestion
064bcb9
1084f6f
* Fri Mar 26 2021 Mamoru TASAKA <mtasaka@fedoraproject.org>
064bcb9
- Update to the latest git (20210321gitdfe9520)
064bcb9
064bcb9
* Tue Mar 23 2021 Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
064bcb9
- Simply mcomix3 starter script (bug 1941827)
064bcb9
- Also create starter script for comicthumb (bug 1941827)
1084f6f
519361a
* Tue Mar  9 2021 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0-0.11.D20210226gite5f39a2
519361a
- Update to the latest git
519361a
b89be89
* Tue Mar  9 2021 Mamoru TASAKA <mtasaka@fedoraproject.org>
b89be89
- Install mime related files and comicthumb
b89be89
519361a
* Mon Feb 22 2021 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0-0.10.D20201223git9ba2f5b
f8988ca
- Update to the latest git
f8988ca
c9ba658
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.9.D20191205gita098f81
c9ba658
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
c9ba658
409f1ee
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.8.D20191205gita098f81
409f1ee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
409f1ee
07a9294
* Tue May 26 2020 Miro HronĨok <mhroncok@redhat.com> - 0-0.7.D20191205gita098f81
07a9294
- Rebuilt for Python 3.9
07a9294
48a2904
* Fri May  8 2020 Mamoru TASAKA <mtasaka@fedoraproject.org> 0-0.6.D20191205gita098f81
48a2904
- Pass argument to start script (Patch by Sean Morgan <sean@shellytrail.net>)
48a2904
37b5d4b
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.5.D20191205gita098f81
37b5d4b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
37b5d4b
441a458
* Mon Dec 30 2019 Mamoru TASAKA <mtasaka@fedoraproject.org> 0-0.4.D20191205gita098f81
452facb
- Update to latest git (20191205)
452facb
1705e00
* Fri Nov  8 2019 Mamoru TASAKA <mtasaka@fedoraproject.org> 0-0.2.D20190616git0405a23
1705e00
- Reflect package review suggestions (bug 1768447)
1705e00
b25042f
* Mon Nov 04 2019 Mamoru TASAKA <mtasaka@fedoraproject.org> 0-0.1.D20190616git0405a23
b25042f
- Initial packaging