Blob Blame Raw
Summary: Reminder utility
Name:    calendar
Version: 1.25
Release: 7%{?dist}
License: BSD
Group:   Applications/Productivity
URL:     http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/calendar

# The source archive is generated with the export-calendar-source.sh
# script.  Update the script's TAG variable when a new version of
# OpenBSD is released.  The version number we use for the calendar
# program is the CVS revision ID of the calendar.c file.  This is
# determined by the script so it can make the source archive.
Source0: %{name}-%{version}.tar.gz
Source1: Makefile.linux
Source2: export-calendar-source.sh

Patch0:  %{name}-1.25-linux.patch
Patch1:  %{name}-1.25-coding.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%description
The OpenBSD calendar command is a reminder utility.  Calendar reads
a mix of configuration files and standard calendar databases and
then displays lines that begin with either today's date or
tomorrow's.  The output of the command shows upcoming events for the
week.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%{__cp} %{SOURCE1} Makefile

for c in calendars/*.*/* ; do
    fromcode="$(%{__grep} '^LANG=' "$c" | %{__sed} 's/^LANG=\(.*\)\.\(.*\)\(@.*\)\{0,1\}/\2/')"
    if [ ! -z "$fromcode" ]; then
        iconv -f "$fromcode" -t "UTF-8" "$c" > "$c.conv"
        %{__mv} "$c.conv" "$c"
    fi
done

%build
%{__make} %{?_smp_mflags}

%install
%{__rm} -rf %{buildroot}
%{__make} install DESTDIR=%{buildroot}

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-,root,root,-)
%attr(755,root,root) %{_bindir}/calendar
%{_mandir}/man1/calendar.1.gz
%{_datadir}/calendar

%changelog
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu Apr 09 2009 David Cantrell <dcantrell@redhat.com> - 1.25-6
- Honor RPM_OPT_FLAGS and fix debuginfo (#494717)

* Tue Mar 03 2009 David Cantrell <dcantrell@redhat.com> - 1.25-5
- Convert output to locale's character coding

* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Tue Feb 17 2009 David Cantrell <dcantrell@redhat.com> - 1.25-3
- Use cvs status to get the revision number of calendar.c

* Tue Feb 17 2009 David Cantrell <dcantrell@redhat.com> - 1.25-2
- Fixed problems in export-calendar-source.sh
- Set permissions on export-calendar-source.sh to 0644

* Thu Feb 12 2009 David Cantrell <dcantrell@redhat.com> - 1.25-1
- Packaged OpenBSD's calendar(1) command from OpenBSD 4.4