diff --git a/psiconv-0.9.8-gcc10.patch b/psiconv-0.9.8-gcc10.patch new file mode 100644 index 0000000..a9f2e49 --- /dev/null +++ b/psiconv-0.9.8-gcc10.patch @@ -0,0 +1,24 @@ +diff -up psiconv-0.9.8/program/psiconv/psiconv.c.me psiconv-0.9.8/program/psiconv/psiconv.c +--- psiconv-0.9.8/program/psiconv/psiconv.c.me 2020-02-24 15:34:30.817159188 +0100 ++++ psiconv-0.9.8/program/psiconv/psiconv.c 2020-02-24 15:35:12.055538713 +0100 +@@ -48,6 +48,8 @@ static void print_help(void); + static void print_version(void); + static void strtoupper(char *str); + ++psiconv_list fileformat_list; /* of struct psiconv_fileformat */ ++ + void print_help(void) + { + fileformat ff; +diff -up psiconv-0.9.8/program/psiconv/psiconv.h.me psiconv-0.9.8/program/psiconv/psiconv.h +--- psiconv-0.9.8/program/psiconv/psiconv.h.me 2020-02-24 15:33:41.433704713 +0100 ++++ psiconv-0.9.8/program/psiconv/psiconv.h 2020-02-24 15:34:05.254923935 +0100 +@@ -52,7 +52,7 @@ typedef struct fileformat_s { + output_function *output; + } *fileformat; + +-psiconv_list fileformat_list; /* of struct psiconv_fileformat */ ++extern psiconv_list fileformat_list; /* of struct psiconv_fileformat */ + + + #endif /* PSICONV_H */ diff --git a/psiconv-0.9.8.tar.gz b/psiconv-0.9.8.tar.gz new file mode 100644 index 0000000..03e75b5 Binary files /dev/null and b/psiconv-0.9.8.tar.gz differ diff --git a/psiconv-checkuid-stdlib.patch b/psiconv-checkuid-stdlib.patch new file mode 100644 index 0000000..7e19a7c --- /dev/null +++ b/psiconv-checkuid-stdlib.patch @@ -0,0 +1,17 @@ +Include for the exit function. This avoids an implicit +function declaration, increasing compatibility with future compilers. +Implicit function declarations have been removed from the C language +in 1999. + +diff --git a/program/extra/checkuid.c b/program/extra/checkuid.c +index d78e7de723abc44c..eae7d60e5bc74a08 100644 +--- a/program/extra/checkuid.c ++++ b/program/extra/checkuid.c +@@ -19,6 +19,7 @@ + + + #include ++#include + + unsigned long uid1[32] = { /* bit 0 */ 0x000045A0, + /* bit 1 */ 0x00008B40, diff --git a/psiconv-configure-c99.patch b/psiconv-configure-c99.patch new file mode 100644 index 0000000..b23f11e --- /dev/null +++ b/psiconv-configure-c99.patch @@ -0,0 +1,185 @@ +Port configure script to C99, avoding implicit function declarations. +Future compilers are likely not to accept them by default. + +There is no need to upstream this because re-running autotools should +rewrite these file sections to use C99-compatible constructs. + +diff --git a/aclocal.m4 b/aclocal.m4 +index 38392ca9cfc50528..bc36662d3857dafa 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -756,10 +756,6 @@ else + # endif + #endif + +-#ifdef __cplusplus +-extern "C" void exit (int); +-#endif +- + void fnord() { int i=42;} + int main () + { +@@ -773,7 +769,7 @@ int main () + /* dlclose (self); */ + } + +- exit (status); ++ return status; + }] + EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then +diff --git a/configure b/configure +index 3008b7005e03f440..764248205d537b62 100755 +--- a/configure ++++ b/configure +@@ -2932,7 +2932,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ +- '' \ ++ '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ +@@ -4152,8 +4152,8 @@ main () + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) +- exit(2); +- exit (0); ++ return 2; ++ return 0; + } + _ACEOF + rm -f conftest$ac_exeext +@@ -8747,10 +8747,6 @@ else + # endif + #endif + +-#ifdef __cplusplus +-extern "C" void exit (int); +-#endif +- + void fnord() { int i=42;} + int main () + { +@@ -8764,7 +8760,7 @@ int main () + /* dlclose (self); */ + } + +- exit (status); ++ return status; + } + EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +@@ -8845,10 +8841,6 @@ else + # endif + #endif + +-#ifdef __cplusplus +-extern "C" void exit (int); +-#endif +- + void fnord() { int i=42;} + int main () + { +@@ -8862,7 +8854,7 @@ int main () + /* dlclose (self); */ + } + +- exit (status); ++ return status; + } + EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +@@ -12451,10 +12443,6 @@ else + # endif + #endif + +-#ifdef __cplusplus +-extern "C" void exit (int); +-#endif +- + void fnord() { int i=42;} + int main () + { +@@ -12468,7 +12456,7 @@ int main () + /* dlclose (self); */ + } + +- exit (status); ++ return status; + } + EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +@@ -12549,10 +12537,6 @@ else + # endif + #endif + +-#ifdef __cplusplus +-extern "C" void exit (int); +-#endif +- + void fnord() { int i=42;} + int main () + { +@@ -12566,7 +12550,7 @@ int main () + /* dlclose (self); */ + } + +- exit (status); ++ return status; + } + EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +@@ -17962,10 +17946,6 @@ else + # endif + #endif + +-#ifdef __cplusplus +-extern "C" void exit (int); +-#endif +- + void fnord() { int i=42;} + int main () + { +@@ -17979,7 +17959,7 @@ int main () + /* dlclose (self); */ + } + +- exit (status); ++ return status; + } + EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +@@ -18060,10 +18040,6 @@ else + # endif + #endif + +-#ifdef __cplusplus +-extern "C" void exit (int); +-#endif +- + void fnord() { int i=42;} + int main () + { +@@ -18077,7 +18053,7 @@ int main () + /* dlclose (self); */ + } + +- exit (status); ++ return status; + } + EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +@@ -19479,8 +19455,8 @@ main () + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) +- exit(2); +- exit (0); ++ return 2; ++ return 0; + } + _ACEOF + rm -f conftest$ac_exeext diff --git a/psiconv.spec b/psiconv.spec new file mode 100644 index 0000000..cbc908a --- /dev/null +++ b/psiconv.spec @@ -0,0 +1,72 @@ +Name: psiconv +Version: 0.9.8 +Release: 1 +Summary: A conversion utility for Psion files +License: GPLv2+ +URL: http://software.frodo.looijaard.name/psiconv/ +Source0: http://software.frodo.looijaard.name/psiconv/files/%{name}-%{version}.tar.gz +Patch0: psiconv-0.9.8-gcc10.patch +Patch1: psiconv-checkuid-stdlib.patch +Patch2: psiconv-configure-c99.patch +BuildRequires: make +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: ImageMagick-devel +BuildRequires: bc + +%description +A conversion utility for the Psion files + +%package devel +Summary: Development files for psiconv +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Contains library and header files for psiconv + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + + +%build +%configure --disable-static +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +make %{?_smp_mflags} + + +%install +make install DESTDIR=$RPM_BUILD_ROOT +find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' +mv $RPM_BUILD_ROOT%{_datadir}/%{name} _doc + + +%ldconfig_scriptlets + + +%files +%doc COPYING NEWS README TODO ChangeLog AUTHORS +%dir %{_sysconfdir}/psiconv +%config %{_sysconfdir}/psiconv/psiconv.conf +%config %{_sysconfdir}/psiconv/psiconv.conf.eg +%{_bindir}/psiconv +%{_mandir}/man1/psiconv.1.gz +%{_libdir}/libpsiconv.so.6 +%{_libdir}/libpsiconv.so.6.4.2 + + +%files devel +%doc _doc/* +%{_bindir}/psiconv-config +%{_mandir}/man1/psiconv-config.1.gz +%{_libdir}/libpsiconv.so +#%{_datadir}/psiconv/ +%{_includedir}/psiconv/ + + +%changelog +* Wed May 24 2023 wangtaozhi - 0.9.8-1 +- Package init diff --git a/psiconv.yaml b/psiconv.yaml new file mode 100644 index 0000000..afca392 --- /dev/null +++ b/psiconv.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: http://software.frodo.looijaard.name/psiconv/ +tag_prefix: "v" +separator: "."