Blame mcomix3.spec

f8988ca
%global		gitcommit		9ba2f5be14ad925605b2c8fa7b9933799f08ef58
f8988ca
%global		gitdate		20201223
b25042f
%global		shortcommit	%(c=%{gitcommit}; echo ${c:0:7})
b25042f
f8988ca
%global		tarballdate	20210221
f8988ca
%global		tarballtime	1251
b25042f
b25042f
Name:			mcomix3
b25042f
# For now, choose version 0
b25042f
Version:		0
f8988ca
Release:		0.10.D%{gitdate}git%{shortcommit}%{?dist}
b25042f
Summary:		User-friendly, customizable image viewer for comic books
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
b25042f
Source2:		mcomix3starter.sh
b25042f
# Borrow some desktop related files
b25042f
Source10:		mcomix3.desktop
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
b25042f
#BuildRequires:	%%{_bindir}/appstream-util
b25042f
BuildRequires:	%{_bindir}/desktop-file-install
b25042f
BuildRequires:	gettext
b25042f
BuildRequires:	git
b25042f
Requires:		gtk3
b25042f
Requires:		python3-gobject
b25042f
Requires:		python3-pillow
b25042f
BuildArch:		noarch
f8988ca
b25042f
Obsoletes:		mcomix < 1.2.2
b25042f
Obsoletes:		comix < 4.0.5
1705e00
Provides:		mcomix = 1.2.2
b25042f
b25042f
b25042f
%description
b25042f
MComix3 is a user-friendly, customizable image viewer.
1705e00
It has been forked from the original MComix project and ported to python3.
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/
b25042f
popd
b25042f
b25042f
%install
b25042f
pushd %{name}
b25042f
cp -p [A-Z]* ..
b25042f
popd
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
b25042f
install -cpm 0755 %{SOURCE2} ${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/
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
b25042f
# data files
b25042f
mv mcomix/ ${DSTTOPDIR}/mcomix3/
b25042f
# Not needed
b25042f
rm -f comicthumb.py
b25042f
mv mcomixstarter.py ${DSTTOPDIR}/
b25042f
b25042f
# Ensure that all files are installed
b25042f
popd
b25042f
rmdir localroot.2/mcomix
b25042f
rmdir localroot.2
b25042f
b25042f
popd
b25042f
# Wrapper symlink
b25042f
mkdir %{buildroot}/%{_bindir}
f8988ca
ln -sf ../../${SITETOPDIR}/mcomix3starter.sh %{buildroot}%{_bindir}/mcomix3
b25042f
# Desktop file
b25042f
mkdir %{buildroot}%{_datadir}/applications
b25042f
desktop-file-install \
b25042f
	--remove-category Application \
b25042f
	--dir %{buildroot}%{_datadir}/applications/ \
b25042f
	%{SOURCE10}
b25042f
b25042f
%find_lang %{name}
b25042f
b25042f
%files -f %{name}.lang
b25042f
%license	COPYING
b25042f
%doc		ChangeLog
b25042f
%doc		README*
b25042f
%doc		TODO
b25042f
b25042f
%{_bindir}/%{name}
b25042f
%{python3_sitelib}/%{name}/
b25042f
# Do not own %%{_datadir}/icons/hicolor explicitly
b25042f
%{_datadir}/icons/hicolor/*/apps/%{name}.png
b25042f
%{_datadir}/applications/%{name}.desktop
b25042f
# TODO: appdata file, not availale yet (should item)
b25042f
b25042f
%changelog
f8988ca
* 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