Skip to content

Commit 27af48f

Browse files
committed
Release 1.0.1
- update the spec file regarding its description, dependencies, the systemd service file - Add classifiers to the setup.py and change how the version is retrieved - Adjust the systemd service file to work out of the box with what is in the spec file
1 parent 08bf091 commit 27af48f

File tree

3 files changed

+58
-18
lines changed

3 files changed

+58
-18
lines changed

gitsync.service

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Description=Service for keeping git repos in sync
55
After=syslog.target network.target
66

77
[Service]
8-
ExecStart=/usr/bin/gitsync --daemon --verbose > /var/log/gitsync &2
8+
ExecStart=/usr/bin/gitsync-cli --daemon --verbose > /var/log/gitsync &2
99

1010
[Install]
1111
WantedBy=multi-user.target

gitsync.spec

+33-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
%define alphatag 20140418
1+
Name: gitsync
2+
Version: 1.0.1
3+
Release: 1%{?dist}
4+
Summary: Automated git-based synchronization
25

3-
Name: gitsync
4-
Version: 0.0.2
5-
Release: 0.1.%{alphatag}git%{?dist}
6-
Summary: Automated git-based synchronization
7-
8-
License: GPLv3+
9-
URL: http://ambre.pingoured.fr/cgit/gitsync.git
6+
License: GPLv3+
7+
URL: https://github.com/pypingou/gitsync
108
# The source was pulled from upstreams git scm. Use the following
119
# commands to generate the tarball
1210
# git clone http://ambre.pingoured.fr/cgit/gitsync.git
1311
# cd gitsync && git archive --format=tar --prefix=gitsync-0.0.1/ fd39ef44ed57a4ede4f586a852598479efa9db13 > ../gitsync-20120102.tar.bz2
14-
Source0: gitsync-%{alphatag}.tar.bz2
12+
Source0: gitsync-1.0.1.tar.bz2
13+
14+
BuildArch: noarch
1515

16-
Requires: python-pytgit2
17-
Requires: python-watchdog
16+
BuildRequires: python2-devel
17+
BuildRequires: systemd-devel
1818

19-
BuildArch: noarch
20-
BuildRequires: python-devel
19+
Requires: python2-pygit2
20+
Requires: python2-watchdog
21+
Requires(post): systemd
22+
Requires(preun): systemd
23+
Requires(postun): systemd
2124

2225

2326
%description
@@ -28,7 +31,8 @@ folder and add/remove/commit the changes which are made there.
2831
This way it kind of provide a similar service then dropbox or
2932
sparkleshare but:
3033
- in python (no mono-pile to install)
31-
- in cron (set your frequency as desired)
34+
- in cron (set your frequency as desired) or in daemon mode (watches the
35+
changes in the file-system and commit as needed)
3236
- in git (get real track changes).
3337

3438
%prep
@@ -44,13 +48,28 @@ rm -rf %{buildroot}
4448
mkdir -p %{buildroot}%{_bindir}
4549
install -m 755 %{name}.py %{buildroot}%{_bindir}/%{name}
4650

51+
mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
52+
install -m 644 gitsync.service \
53+
$RPM_BUILD_ROOT/%{_unitdir}/gitsync.service
54+
55+
%post
56+
%systemd_post gitsync.service
57+
%preun
58+
%systemd_preun gitsync.service
59+
%postun
60+
%systemd_postun_with_restart gitsync.service
61+
4762

4863
%files
4964
%doc README LICENSE
5065
%{_bindir}/%{name}
66+
%{_unitdir}/gitsync.service
5167

5268

5369
%changelog
70+
* Wed Jan 04 2017 Pierre-Yves Chibon <[email protected]> - 1.0.1-1
71+
- Update to 1.0.1
72+
5473
* Fri April 18 2014 Pierre-Yves Chibon <pingou AT pingoured DOT fr> - 0.0.2-0.1.20140418git
5574
- Bump to a 0.0.2 release
5675
- Add dependency to python-watchdog and python-pygit2

setup.py

+24-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,21 @@
44
Setup script
55
"""
66

7-
from gitsync import __version__
7+
import os
8+
import re
9+
810
from setuptools import setup
911

1012

13+
gitsyncfile = os.path.join(os.path.dirname(__file__), 'gitsync.py')
14+
# Thanks to SQLAlchemy:
15+
# https://github.com/zzzeek/sqlalchemy/blob/master/setup.py#L104
16+
with open(gitsyncfile) as stream:
17+
__version__ = re.compile(
18+
r".*__version__ = '(.*?)'", re.S
19+
).match(stream.read()).group(1)
20+
21+
1122
def get_requires():
1223
''' Reads the requirements.txt and return its content in a list. '''
1324
stream = open('requirements.txt')
@@ -23,7 +34,6 @@ def get_requires():
2334

2435
return deps
2536

26-
requires = get_requires()
2737

2838
setup(
2939
name='gitsync',
@@ -33,11 +43,22 @@ def get_requires():
3343
author_email='[email protected]',
3444
url='https://github.com/pypingou/gitsync',
3545
download_url='https://pypi.python.org/pypi/gitsync',
46+
license='GPLv3+',
3647
py_modules=['gitsync'],
37-
install_requires=requires,
48+
install_requires=get_requires(),
3849
entry_points={
3950
'console_scripts': [
4051
"gitsync-cli=gitsync:main",
4152
]
4253
},
54+
classifiers=[
55+
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
56+
'Operating System :: POSIX :: Linux',
57+
'Programming Language :: Python :: 2',
58+
'Programming Language :: Python :: 2.6',
59+
'Programming Language :: Python :: 2.7',
60+
'Programming Language :: Python :: 3',
61+
'Topic :: System :: Archiving',
62+
'Topic :: Utilities',
63+
]
4364
)

0 commit comments

Comments
 (0)