Blob Blame History Raw
%global		gitcommit		9ba2f5be14ad925605b2c8fa7b9933799f08ef58
%global		gitdate		20201223
%global		shortcommit	%(c=%{gitcommit}; echo ${c:0:7})

%global		tarballdate	20210221
%global		tarballtime	1251

Name:			mcomix3
# For now, choose version 0
Version:		0
Release:		0.10.D%{gitdate}git%{shortcommit}%{?dist}
Summary:		User-friendly, customizable image viewer for comic books
# GPL version info is from mcomix/
License:		GPLv2+
# Use git repository directly - with it when modifying source
# we can do it *in git repository* and then we can directly submit
# patch to the upstream by pull request
Source0:		%{name}-%{tarballdate}T%{tarballtime}.tar.bz2
# Source0 is created by Source1
# Some additional files
# Borrow some desktop related files
Source10:		mcomix3.desktop
# Patches
Patch2:		0002-Change-domain-name-for-gettext.patch
Patch3:		0003-Search-gettext-files-in-system-wide-directory.patch

BuildRequires:	python3-devel
#BuildRequires:	%%{_bindir}/appstream-util
BuildRequires:	%{_bindir}/desktop-file-install
BuildRequires:	gettext
BuildRequires:	git
Requires:		gtk3
Requires:		python3-gobject
Requires:		python3-pillow
BuildArch:		noarch

Obsoletes:		mcomix < 1.2.2
Obsoletes:		comix < 4.0.5
Provides:		mcomix = 1.2.2

MComix3 is a user-friendly, customizable image viewer.
It has been forked from the original MComix project and ported to python3.

%setup -q -c -T -a 0

# Setup source git repository
git clone ./%{name}.git
cd %{name}

git config "%{name} Fedora maintainer"
git config "%{name}"
git checkout -b %{version}-%{release}-fedora %{gitcommit}

# Apply patches
cat %{PATCH2} | git am
cat %{PATCH3} | git am

pushd %{name}
rm -rf localroot
mkdir localroot

python3 --srcdir=mcomix --target=$(pwd)/localroot/

pushd %{name}
cp -p [A-Z]* ..

# Install manually...
mkdir -p ${DSTTOPDIR}
mkdir -p ${DSTTOPDIR}/mcomix3
mkdir -p %{buildroot}%{_datadir}/locale
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/

pushd %{name}
rm -rf localroot.2
cp -a localroot localroot.2

pushd localroot.2/mcomix

# Wrapper script
install -cpm 0755 %{SOURCE2} ${DSTTOPDIR}
# locale files
find mcomix/messages/* -type f | while read f
	dir=$(dirname $f)
	mv $f $dir/%{name}.mo
mv mcomix/messages/* %{buildroot}%{_datadir}/locale/
# duplicate icon
for dir in mcomix/images/*x*/
	basedir=$(basename $dir)
	mkdir -p %{buildroot}%{_datadir}/icons/hicolor/$basedir/apps
	cp -p $dir/*png %{buildroot}%{_datadir}/icons/hicolor/$basedir/apps/%{name}.png
# data files
mv mcomix/ ${DSTTOPDIR}/mcomix3/
# Not needed
rm -f

# Ensure that all files are installed
rmdir localroot.2/mcomix
rmdir localroot.2

# Wrapper symlink
mkdir %{buildroot}/%{_bindir}
ln -sf ../../${SITETOPDIR}/ %{buildroot}%{_bindir}/mcomix3
# Desktop file
mkdir %{buildroot}%{_datadir}/applications
desktop-file-install \
	--remove-category Application \
	--dir %{buildroot}%{_datadir}/applications/ \

%find_lang %{name}

%files -f %{name}.lang
%license	COPYING
%doc		ChangeLog
%doc		README*
%doc		TODO

# Do not own %%{_datadir}/icons/hicolor explicitly
# TODO: appdata file, not availale yet (should item)

* Mon Feb 22 2021 Mamoru TASAKA <> 0-0.10.D20201223git9ba2f5b
- Update to the latest git

* Tue Jan 26 2021 Fedora Release Engineering <> - 0-0.9.D20191205gita098f81
- Rebuilt for

* Tue Jul 28 2020 Fedora Release Engineering <> - 0-0.8.D20191205gita098f81
- Rebuilt for

* Tue May 26 2020 Miro HronĨok <> - 0-0.7.D20191205gita098f81
- Rebuilt for Python 3.9

* Fri May  8 2020 Mamoru TASAKA <> 0-0.6.D20191205gita098f81
- Pass argument to start script (Patch by Sean Morgan <>)

* Wed Jan 29 2020 Fedora Release Engineering <> - 0-0.5.D20191205gita098f81
- Rebuilt for

* Mon Dec 30 2019 Mamoru TASAKA <> 0-0.4.D20191205gita098f81
- Update to latest git (20191205)

* Fri Nov  8 2019 Mamoru TASAKA <> 0-0.2.D20190616git0405a23
- Reflect package review suggestions (bug 1768447)

* Mon Nov 04 2019 Mamoru TASAKA <> 0-0.1.D20190616git0405a23
- Initial packaging