[packages/fortune-mod] - new URLs, updated to 3.18.0 - removed outdated rot patch - added install patch (adjust fortune bin

qboosh qboosh at pld-linux.org
Tue Mar 7 21:27:03 CET 2023


commit 4f8ce8733ea0a4f72f3020b29ca24f55cf44a581
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Tue Mar 7 21:29:03 2023 +0100

    - new URLs, updated to 3.18.0
    - removed outdated rot patch
    - added install patch (adjust fortune bindir to previous value)

 fortune-mod-install.patch |  11 ++++
 fortune-mod-rot.patch     |  11 ----
 fortune-mod-usage.patch   | 131 +++++++++++++++++++++++++++-------------------
 fortune-mod.spec          |  50 +++++++++---------
 4 files changed, 112 insertions(+), 91 deletions(-)
---
diff --git a/fortune-mod.spec b/fortune-mod.spec
index 27d2843..9ed954b 100644
--- a/fortune-mod.spec
+++ b/fortune-mod.spec
@@ -14,18 +14,20 @@ Summary(pt_BR.UTF-8):	Fortune: frases famosas e ditados
 Summary(ru.UTF-8):	Программа, печатающая "fortune" (случайно выбранное сообщение)
 Summary(uk.UTF-8):	Програма, яка друкує "fortune" (випадково вибране повідомлення)
 Name:		fortune-mod
-Version:	1.99.1
-Release:	5
+Version:	3.18.0
+Release:	1
 License:	BSD
 Group:		Applications/Games
-#Source0:	ftp://sunsite.unc.edu/pub/Linux/games/amusements/fortune/%{name}-9708.tar.gz
-Source0:	http://www.redellipse.net/code/downloads/%{name}-%{version}.tar.gz
-# Source0-md5:	f208805b3b712e32997d7667e0ec52d8
+Source0:	https://www.shlomifish.org/open-source/projects/fortune-mod/arcs/%{name}-%{version}.tar.xz
+# Source0-md5:	8ab5d3f6818fd4c98eebf6408e65b4a0
 Source1:	%{name}.sh
 Source2:	%{name}.csh
 Patch0:		%{name}-usage.patch
-Patch1:		%{name}-rot.patch
+Patch1:		%{name}-install.patch
+URL:		https://www.shlomifish.org/open-source/projects/fortune-mod/
 BuildRequires:	recode-devel
+BuildRequires:	tar >= 1:1.22
+BuildRequires:	xz
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -157,27 +159,21 @@ pakiet jest tym, czego potrzebujesz.
 %patch1 -p1
 
 %build
-%{__make} \
-	CFLAGS="%{rpmcflags} \\\$(DEFINES)" \
-	%{?with_offensive:OFFENSIVE=1}
+install -d build
+cd build
+%cmake .. \
+	%{!?with_offensive:-DNO_OFFENSIVE=ON}
 
-%{__make} fortune/fortune.man
+%{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man{1,6},%{_datadir}/games/fortune,/etc/profile.d}
+install -d $RPM_BUILD_ROOT/etc/profile.d
 
-%{__make} install \
-	FORTDIR=$RPM_BUILD_ROOT%{_bindir} \
-	COOKIEDIR=$RPM_BUILD_ROOT%{_datadir}/games/fortunes \
-	BINDIR=$RPM_BUILD_ROOT%{_bindir} \
-	BINMANDIR=$RPM_BUILD_ROOT%{_mandir}/man1 \
-	FORTMANDIR=$RPM_BUILD_ROOT%{_mandir}/man6 \
-	%{?with_offensive:OFFENSIVE=1}
+%{__make} -C build install \
+	DESTDIR=$RPM_BUILD_ROOT
 
-rm -f $RPM_BUILD_ROOT%{_mandir}/man1/unstr.1*
-
-cp -a %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT/etc/profile.d
+cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT/etc/profile.d
 echo '.so strfile.1' > $RPM_BUILD_ROOT%{_mandir}/man1/unstr.1
 
 %clean
@@ -186,16 +182,20 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %doc README ChangeLog TODO
-%attr(755,root,root) %{_bindir}/*
+%attr(755,root,root) %{_bindir}/fortune
+%attr(755,root,root) %{_bindir}/rot
+%attr(755,root,root) %{_bindir}/strfile
+%attr(755,root,root) %{_bindir}/unstr
 %{_mandir}/man6/fortune.6*
-%{_mandir}/man1/*
+%{_mandir}/man1/strfile.1*
+%{_mandir}/man1/unstr.1*
 %dir %{_datadir}/games/fortunes
 
 %files data
 %defattr(644,root,root,755)
 %{_datadir}/games/fortunes/*
-%defattr(644,root,root,755)
 
 %files on-login
 %defattr(644,root,root,755)
-/etc/profile.d/*
+/etc/profile.d/fortune-mod.csh
+/etc/profile.d/fortune-mod.sh
diff --git a/fortune-mod-install.patch b/fortune-mod-install.patch
new file mode 100644
index 0000000..71f960f
--- /dev/null
+++ b/fortune-mod-install.patch
@@ -0,0 +1,11 @@
+--- fortune-mod-3.18.0/CMakeLists.txt.orig	2023-03-03 05:58:47.000000000 +0100
++++ fortune-mod-3.18.0/CMakeLists.txt	2023-03-07 21:22:40.765839643 +0100
+@@ -173,7 +173,7 @@ ENDMACRO()
+ my_exe(
+     "fortune"
+     "fortune/fortune.c"
+-    "games"
++    "bin"
+ )
+ 
+ my_exe(
diff --git a/fortune-mod-rot.patch b/fortune-mod-rot.patch
deleted file mode 100644
index e5f96b4..0000000
--- a/fortune-mod-rot.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- fortune-mod-1.99.1/util/rot.c.orig	2020-05-02 19:13:22.567488950 +0200
-+++ fortune-mod-1.99.1/util/rot.c	2020-05-02 19:13:36.327405143 +0200
-@@ -8,7 +8,7 @@
- 
- int main(void)
- {
--    char a, b;
-+    int a, b;
- 
-     while ((a = getchar()) != EOF)
-     {
diff --git a/fortune-mod-usage.patch b/fortune-mod-usage.patch
index 79c92b9..3bd383b 100644
--- a/fortune-mod-usage.patch
+++ b/fortune-mod-usage.patch
@@ -1,57 +1,78 @@
---- fortune-mod-1.99.1/fortune/fortune.c.orig	2004-03-05 14:29:56.000000000 +0100
-+++ fortune-mod-1.99.1/fortune/fortune.c	2004-03-07 18:21:39.218004384 +0100
-@@ -267,11 +267,11 @@
- void usage(void)
+--- fortune-mod-3.18.0/fortune/fortune.c.orig	2023-03-07 20:29:28.209801870 +0100
++++ fortune-mod-3.18.0/fortune/fortune.c	2023-03-07 20:41:20.522609607 +0100
+@@ -240,11 +240,11 @@ static char *program_version(void)
+ static void __attribute__((noreturn)) usage(void)
  {
-     (void) fprintf(stderr, "%s\n",program_version());
--    (void) fprintf(stderr, "fortune [-a");
-+    (void) fprintf(stderr, "fortune [-ac");
- #ifdef	DEBUG
-     (void) fprintf(stderr, "D");
+     (void)fprintf(stderr, "%s\n", program_version());
+-    (void)fprintf(stderr, "%s", "fortune [-a");
++    (void)fprintf(stderr, "fortune [-ac");
+ #ifdef DEBUG
+     (void)fprintf(stderr, "%s", "D");
  #endif /* DEBUG */
--    (void) fprintf(stderr, "f");
-+    (void) fprintf(stderr, "ef");
- #ifndef	NO_REGEX
-     (void) fprintf(stderr, "i");
- #endif /* NO_REGEX */
---- fortune-mod-1.99.1/fortune/fortune.6.orig	2004-03-05 14:29:56.000000000 +0100
-+++ fortune-mod-1.99.1/fortune/fortune.6	2004-03-07 18:23:38.720837192 +0100
-@@ -44,8 +44,9 @@
- .Nd print a random, hopefully interesting, adage
- .Sh SYNOPSIS
- .Nm fortune
--.Op Fl aefilosw
-+.Op Fl acefilosw
- .Op Fl m Ar pattern 
-+.Op Fl n Ar number
- .Oo 
- .Op Ar N% 
- .Ar file/dir/all
-@@ -64,6 +65,8 @@
- (See the
- .Fl o
- option for more information on offensive fortunes.)
-+.It Fl c
-+Show the name of fortune file displayed maxim comes from.
- .It Fl e
- Consider all fortune files to be of equal size (see discussion below
- on multiple files).
-@@ -78,6 +81,9 @@
- See
- .Xr regex 3
- for a description of patterns.
-+.It Fl n
-+Set maximum number of character in a "short" fortune (to be used
-+instead of default 160).
- .It Fl o
- Choose only from potentially offensive aphorisms.
- .Bf -symbolic
-@@ -110,6 +116,8 @@
- number of characters in the message.
- This is useful if it is executed as part of the logout procedure
- to guarantee that the message can be read before the screen is cleared.
-+.It Fl v
-+Display version information and exit.
- .El
- .Pp
- The user may specify alternate sayings.
+-    (void)fprintf(stderr, "%s", "f");
++    (void)fprintf(stderr, "ef");
+ #ifdef WITH_REGEX
+     (void)fprintf(stderr, "%s", "i");
+ #endif
+--- fortune-mod-3.18.0/fortune/fortune_with_offensive.docbook5.xml.orig	2022-10-28 12:15:20.000000000 +0200
++++ fortune-mod-3.18.0/fortune/fortune_with_offensive.docbook5.xml	2023-03-07 20:54:40.271610329 +0100
+@@ -208,6 +208,12 @@ patterns.</para>
+   </listitem>
+   </varlistentry>
+   <varlistentry>
++  <term><emphasis role='strong' remap='B'>-v</emphasis></term>
++  <listitem>
++  <para>Display version information and exit.</para>
++  </listitem>
++  </varlistentry>
++  <varlistentry>
+   <term><emphasis role='strong' remap='B'>-w</emphasis></term>
+   <listitem>
+ <para>Wait before termination for an amount of time calculated from the
+--- fortune-mod-3.18.0/fortune/fortune_without_offensive.docbook5.xml.orig	2022-10-28 12:15:19.000000000 +0200
++++ fortune-mod-3.18.0/fortune/fortune_without_offensive.docbook5.xml	2023-03-07 20:55:09.988116007 +0100
+@@ -174,6 +174,12 @@ patterns.</para>
+   </listitem>
+   </varlistentry>
+   <varlistentry>
++  <term><emphasis role='strong' remap='B'>-v</emphasis></term>
++  <listitem>
++  <para>Display version information and exit.</para>
++  </listitem>
++  </varlistentry>
++  <varlistentry>
+   <term><emphasis role='strong' remap='B'>-w</emphasis></term>
+   <listitem>
+ <para>Wait before termination for an amount of time calculated from the
+--- fortune-mod-3.18.0/fortune/fortune_with_offensive.template.man.orig	2022-10-28 12:15:20.000000000 +0200
++++ fortune-mod-3.18.0/fortune/fortune_with_offensive.template.man	2023-03-07 20:57:03.934165375 +0100
+@@ -155,6 +155,13 @@ patterns\&.
+ 
+ .RE
+ .PP
++\fB\-v\fR
++.RS 4
++
++Display version information and exit\&.
++
++.RE
++.PP
+ \fB\-w\fR
+ .RS 4
+ 
+--- fortune-mod-3.18.0/fortune/fortune_without_offensive.template.man.orig	2022-10-28 12:15:20.000000000 +0200
++++ fortune-mod-3.18.0/fortune/fortune_without_offensive.template.man	2023-03-07 20:57:37.043986004 +0100
+@@ -132,6 +132,13 @@ patterns\&.
+ 
+ .RE
+ .PP
++\fB\-v\fR
++.RS 4
++
++Display version information and exit\&.
++
++.RE
++.PP
+ \fB\-w\fR
+ .RS 4
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/fortune-mod.git/commitdiff/4f8ce8733ea0a4f72f3020b29ca24f55cf44a581



More information about the pld-cvs-commit mailing list