Fri, 03 Aug 2012 20:11:53 +0200
Neutralize buggy code causing OpenPKG to have 'fatal problems' in
spite of correct installation, configuration, and operation. An
administrator suffering from this failure is even unable to
uninstall the flawed software.
michael@423 | 1 | ## |
michael@423 | 2 | ## top.spec -- OpenPKG RPM Package Specification |
michael@423 | 3 | ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/> |
michael@423 | 4 | ## |
michael@423 | 5 | ## Permission to use, copy, modify, and distribute this software for |
michael@423 | 6 | ## any purpose with or without fee is hereby granted, provided that |
michael@423 | 7 | ## the above copyright notice and this permission notice appear in all |
michael@423 | 8 | ## copies. |
michael@423 | 9 | ## |
michael@423 | 10 | ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
michael@423 | 11 | ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
michael@423 | 12 | ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
michael@423 | 13 | ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
michael@423 | 14 | ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
michael@423 | 15 | ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
michael@423 | 16 | ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
michael@423 | 17 | ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
michael@423 | 18 | ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
michael@423 | 19 | ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
michael@423 | 20 | ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
michael@423 | 21 | ## SUCH DAMAGE. |
michael@423 | 22 | ## |
michael@423 | 23 | |
michael@423 | 24 | # package version |
michael@423 | 25 | %define V_dist 3.8beta1 |
michael@423 | 26 | %define V_opkg 3.8b1 |
michael@423 | 27 | |
michael@423 | 28 | # package information |
michael@423 | 29 | Name: top |
michael@423 | 30 | Summary: Full-Screen Process Display |
michael@423 | 31 | URL: http://www.unixtop.org/ |
michael@423 | 32 | Vendor: William LeFebvre |
michael@423 | 33 | Packager: OpenPKG Foundation e.V. |
michael@423 | 34 | Distribution: OpenPKG Community |
michael@423 | 35 | Class: EVAL |
michael@423 | 36 | Group: Monitoring |
michael@423 | 37 | License: Freely Redistributable |
michael@423 | 38 | Version: %{V_opkg} |
michael@424 | 39 | Release: 20120800 |
michael@423 | 40 | |
michael@423 | 41 | # list of sources |
michael@423 | 42 | Source0: http://www.unixtop.org/dist/top-%{V_dist}.tar.gz |
michael@423 | 43 | |
michael@423 | 44 | # build information |
michael@423 | 45 | Prefix: %{l_prefix} |
michael@423 | 46 | BuildRoot: %{l_buildroot} |
michael@423 | 47 | BuildPreReq: OpenPKG, openpkg >= 20040130 |
michael@423 | 48 | PreReq: OpenPKG, openpkg >= 20040130 |
michael@423 | 49 | AutoReq: no |
michael@423 | 50 | AutoReqProv: no |
michael@423 | 51 | |
michael@423 | 52 | %description |
michael@423 | 53 | Top is a full-screen display of the currently running system |
michael@423 | 54 | processes. |
michael@423 | 55 | |
michael@423 | 56 | %track |
michael@423 | 57 | prog top = { |
michael@423 | 58 | version = %{V_dist} |
michael@423 | 59 | url = http://www.unixtop.org/download/ |
michael@423 | 60 | regex = top-(__VER__)\.tar\.gz |
michael@423 | 61 | } |
michael@423 | 62 | |
michael@423 | 63 | %prep |
michael@423 | 64 | %setup -q -n top-%{V_dist} |
michael@424 | 65 | mkdir asm |
michael@424 | 66 | cat > asm/page.h <<EOF |
michael@424 | 67 | #ifndef _I386_PAGE_H |
michael@424 | 68 | #define _I386_PAGE_H |
michael@424 | 69 | |
michael@424 | 70 | /* PAGE_SHIFT determines the page size */ |
michael@424 | 71 | #define PAGE_SHIFT 12 |
michael@424 | 72 | #define PAGE_SIZE (1UL << PAGE_SHIFT) |
michael@424 | 73 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
michael@424 | 74 | |
michael@424 | 75 | #define LARGE_PAGE_MASK (~(LARGE_PAGE_SIZE-1)) |
michael@424 | 76 | #define LARGE_PAGE_SIZE (1UL << PMD_SHIFT) |
michael@424 | 77 | |
michael@424 | 78 | |
michael@424 | 79 | #endif /* _I386_PAGE_H */ |
michael@424 | 80 | EOF |
michael@423 | 81 | |
michael@423 | 82 | %build |
michael@423 | 83 | # configure program |
michael@423 | 84 | CC="%{l_cc}" \ |
michael@423 | 85 | CFLAGS="%{l_cflags -O}" \ |
michael@423 | 86 | ./configure \ |
michael@423 | 87 | --prefix=%{l_prefix} |
michael@423 | 88 | |
michael@423 | 89 | # build program |
michael@423 | 90 | %{l_make} %{l_mflags} |
michael@423 | 91 | |
michael@423 | 92 | %install |
michael@423 | 93 | rm -rf $RPM_BUILD_ROOT |
michael@423 | 94 | |
michael@423 | 95 | # install program |
michael@423 | 96 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@423 | 97 | $RPM_BUILD_ROOT%{l_prefix}/bin \ |
michael@423 | 98 | $RPM_BUILD_ROOT%{l_prefix}/man/man1 |
michael@423 | 99 | %{l_shtool} install -c -s -m 755 \ |
michael@423 | 100 | top $RPM_BUILD_ROOT%{l_prefix}/bin/ |
michael@423 | 101 | %{l_shtool} install -c -m 644 \ |
michael@423 | 102 | top.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/ |
michael@423 | 103 | |
michael@423 | 104 | # determine installation files |
michael@423 | 105 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@423 | 106 | %{l_files_std} \ |
michael@423 | 107 | '%attr(4711,%{l_susr},%{l_mgrp}) %{l_prefix}/bin/top' |
michael@423 | 108 | |
michael@423 | 109 | %files -f files |
michael@423 | 110 | |
michael@423 | 111 | %clean |
michael@423 | 112 | rm -rf $RPM_BUILD_ROOT |
michael@423 | 113 |