LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File cycle.spec of Package cycle (Project home:Lazy_Kent)

# spec file for package cycle
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/

Name:           cycle
Version:        0.3.1
Release:        0
License:        GPL-2.0+
Summary:        Calendar for Women
Url:            http://cycle.sourceforge.net/
Group:          Productivity/Scientific/Other
Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
Source1:        export.png
Patch0:         cycle-0.3.1-directories.patch
Patch1:         cycle-0.3.1-dialogs_fix.patch
Patch2:         cycle-0.3.1-dialogs_message.patch
Patch3:         cycle-0.3.1-dialogs_strings.patch
Patch4:         cycle-0.3.1-cal_year_strings.patch
Patch5:         cycle-0.3.1-report_year_ical.patch
Patch6:         cycle-0.3.1-export_to_ical.patch
Patch7:         cycle-0.3.1-translations.patch
BuildRequires:  ImageMagick
BuildRequires:  hicolor-icon-theme
%if 0%{?suse_version} >= 1210
BuildRequires:  python-distribute
BuildRequires:  python-setuptools
BuildRequires:  update-desktop-files
Requires:       python-wxWidgets
BuildArch:      noarch
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Cycle is a calendar program for women. Given a cycle length or
statistics for several periods, it can calculate the days until
menstruation, the days of "safe" sex, the fertile period, and the days
to ovulations, and define the d.o.b. of a child. It allows the user to
write notes and helps to supervise the reception of hormonal
contraceptive tablets.


%setup -q
cp %{SOURCE1} bitmaps

# Convert Russian help file to UTF-8.
iconv -f KOI8-R -t UTF-8 README_ru.html | \
sed 's/charset=koi8-r/charset=UTF-8/' > README_ru.tmp && \
mv -f README_ru.tmp README_ru.html

# Convert German help file to UTF-8.
iconv -f CP1252 -t UTF-8 -o README_de.tmp README_de.html && \
mv -f README_de.tmp README_de.html

# Compile locales.
for i in msg/*.po ; do
    msgfmt ${i} -o ${i%po}mo

# Create desktop file.
cat > %{name}.desktop << EOF
[Desktop Entry]
GenericName=Calendar for Women
GenericName[ru]=Календарь для женщин
Comment=Menstrual Cycle Calendar
Comment[ru]=Календарь менструальных циклов

# Install cycle.py and *.egg-info.
python setup.py install \
    --root=%{buildroot} \

# Install locales.
pushd msg
for i in *.mo ; do
    install -Dm 0644 ${i} \

# Install other files.
install -dm 0755 \
ln -s %{python_sitelib}/%{name}.py %{buildroot}%{_bindir}/%{name}
install -m 0644 bitmaps/* \
install -m 0644 icons/%{name}.* \
install -m 0644 icons/large/%{name}.* \
install -m 0644 icons/mini/%{name}.* \
install -m 0644 \
    cal_year.py dialogs.py p_rotor.py save_load.py set_dir.py \

# Python byte compile.
pushd %{buildroot}%{python_sitelib}
%py_compile .

# Install icons of various sizes.
for size in 48x48 32x32 16x16 ; do
    install -dm 0755 \
convert icons/mini/%{name}.xpm \
convert icons/%{name}.xpm \
convert icons/large/%{name}.xpm \

# Install man page.
install -Dm 0644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1

%find_lang %{name}
%suse_update_desktop_file -i %{name}



%doc README_ru.html THANKS
%doc %{_mandir}/man?/*
%attr(0755,root,root) %{python_sitelib}/%{name}.py

%files lang -f %{name}.lang