Browse Source

new package: newt 0.51.6.2 (S-Lang based Text Terminal Widget Toolkit)

Ralf S. Engelschall 22 years ago
parent
commit
4992f5a779
3 changed files with 2450 additions and 0 deletions
  1. 2311 0
      newt/newt.patch
  2. 10 0
      newt/newt.pc
  3. 129 0
      newt/newt.spec

File diff suppressed because it is too large
+ 2311 - 0
newt/newt.patch


+ 10 - 0
newt/newt.pc

@@ -0,0 +1,10 @@
+prefix=@l_prefix@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: newt
+Description: s-lang widget toolkit
+Version: @version@
+Libs: -L${libdir} @libs@
+Cflags: -I${includedir}

+ 129 - 0
newt/newt.spec

@@ -0,0 +1,129 @@
+##
+##  newt.spec -- OpenPKG RPM Specification
+##  Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
+##  Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
+##  Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.com/>
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+
+#   package version
+%define       V_major 0.51.6
+%define       V_minor 2
+
+#   package information
+Name:         newt
+Summary:      S-Lang based Text Terminal Widget Toolkit
+URL:          ftp://download.fedora.redhat.com/pub/fedora/linux/core/development/SRPMS/
+Vendor:       Eric Troan
+Packager:     The OpenPKG Project
+Distribution: OpenPKG [EVAL]
+Group:        Terminal
+License:      LGPL
+Version:      %{V_major}.%{V_minor}
+Release:      20031214
+
+#   list of sources
+Source0:      ftp://download.fedora.redhat.com/pub/fedora/linux/core/development/SRPMS/newt-%{V_major}-%{V_minor}.src.rpm
+Source1:      newt.pc
+Patch0:       newt.patch
+
+#   build information
+Prefix:       %{l_prefix}
+BuildRoot:    %{l_buildroot}
+BuildPreReq:  OpenPKG, openpkg >= 20030103, slang, popt
+PreReq:       OpenPKG, openpkg >= 20030103, slang
+AutoReq:      no
+AutoReqProv:  no
+
+%description
+    Newt is a S-Lang based text terminal Widget toolkit. It was
+    originally designed for use in the installer program for Red Hat
+    Linux. Newt is not event driven but easy to use. Windows must be
+    created and destroyed as a stack (in other words, all Newt windows
+    behave as modal dialogs).
+
+%prep
+    #   unpack and patch distribution
+    %setup -q -c -T
+    %{l_prefix}/bin/rpm2cpio %{SOURCE0} | cpio -idvmu
+    %{l_gzip} -d -c newt-%{V_major}.tar.gz | %{l_tar} xf -
+    ( cd newt-%{V_major}
+      %patch -p0
+      chmod u+r *.orig
+    ) || exit $?
+
+%build
+    #   determine available terminal library
+    #   kludge: determine whether vendor termcap, termlib or curses library exists
+    #   reason: some brain-dead platforms (like SuSE, etc) have no termcap library installed.
+    termlib=""
+    echo "int main(int argc, char *argv[]) { return 0; }" >dummy.c
+    for lib in termcap termlib curses ncurses; do
+        rc=0; %{l_cc} -o dummy dummy.c -l$lib >/dev/null 2>&1 || rc=1
+        if [ $rc -eq 0 ]; then termlib="-l$lib"; break; fi
+    done
+    [ ".$termlib" = . ] && exit 1
+    %{l_shtool} install -c \
+        -e 's;@version@;%{version};g' \
+        -e "s;@libs@;-lslang $termlib;g" \
+        %{SOURCE newt.pc} .
+
+    #   build package
+    ( cd newt-%{V_major}
+      CC="%{l_cc}" \
+      CFLAGS="%{l_cflags -O}" \
+      CPPFLAGS="%{l_cppflags}" \
+      LDFLAGS="%{l_ldflags}" \
+      LIBS="$termlib" \
+      ./configure \
+          --prefix=%{l_prefix}
+      %{l_make} %{l_mflags -O}
+    ) || exit $?
+
+%install
+    #   install package
+    rm -rf $RPM_BUILD_ROOT
+    ( cd newt-%{V_major}
+      %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
+    ) || exit $?
+
+    #   install tutorial as manual page
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/man/cat3
+    %{l_shtool} install -c -m 644 \
+        newt-%{V_major}/tutorial.txt \
+        $RPM_BUILD_ROOT%{l_prefix}/man/cat3/newt.3
+
+    #   install pkgconfig(1) file
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
+    %{l_shtool} install -c -m 644 %{l_value -s -a} \
+        newt.pc $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
+
+    #   determine installation files
+    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+        %{l_files_std} \
+        '%not %dir %{l_prefix}/lib/pkgconfig'
+
+%files -f files
+
+%clean
+    rm -rf $RPM_BUILD_ROOT
+