RPM-Writing Lab 2

31 Jan

[root@fedora RPMS]# rpmlint x86_64
ocrad-debuginfo.x86_64: E: no-changelogname-tag
ocrad-debuginfo.x86_64: W: invalid-license free
ocrad-debuginfo.x86_64: E: debuginfo-without-sources
ocrad.x86_64: W: summary-not-capitalized C test
ocrad.x86_64: E: no-description-tag
ocrad.x86_64: E: no-changelogname-tag
ocrad.x86_64: W: invalid-license free
ocrad.x86_64: W: devel-file-in-non-devel-package /usr/include/ocradlib.h
ocrad.x86_64: E: info-files-without-install-info-postin /usr/share/info/ocrad.info.gz
ocrad.x86_64: E: info-files-without-install-info-postun /usr/share/info/ocrad.info.gz
ocrad.x86_64: E: info-dir-file /usr/share/info/dir
ocrad.x86_64: E: info-files-without-install-info-postin /usr/share/info/dir
ocrad.x86_64: E: info-files-without-install-info-postun /usr/share/info/dir
ocrad.x86_64: W: devel-file-in-non-devel-package /usr/libexec/libocrad.a
2 packages and 0 specfiles checked; 9 errors, 5 warnings

There is no %changelog tag in your spec file. To insert it, just insert a
‘%changelog’ in your spec file and rebuild it
%changelog
*Jan 26 renew

 /usr/bin/ocrad
   /usr/include/ocradlib.h
   /usr/libexec/libocrad.a
   /usr/share/info/dir
   /usr/share/info/ocrad.info.gz
   /usr/share/man/man1/ocrad.1.gz

 

[root@fedora SPECS]# rpmlint ocrad.spec
ocrad.spec: W: invalid-url Source0: ocrad-0.20.tar.gz
0 packages and 1 specfiles checked; 0 errors, 1 warnings.

[root@fedora rpmbuild]# rpmlint -i ocrad-0.20-10.fc16.src.rpm
(none): E: no installed packages by name ocrad-0.20-10.fc16.src.rpm
0 packages and 0 specfiles checked; 0 errors, 0 warnings.

[root@fedora rpmbuild]# rpmlint x86_64
(none): E: no installed packages by name x86_64
0 packages and 0 specfiles checked; 0 errors, 0 warnings

RPM-Writing Lab

22 Jan

prepareation
1. Install the required packages:

    yum groupinstall “Fedora Packager”
    yum install rpmlint yum-utils
    
2. Create the ~/rpmbuild directories and the ~/.rpmmacros file by running this command: rpmdev-setuptree

[root@fedora rpmbuild]# ls
BUILD  BUILDROOT  RPMS  SOURCES  SPECS  SRPMS
[root@fedora rpmbuild]

Lab steps
1. Put the package source code (tarball) in ~/rpmbuild/SOURCES

[root@fedora Downloads]# cp ocrad-0.20.tar.gz ~/rpmbuild/SOURCES
 
cd ~/rpmbuild/SPECS

2. Create an empty skeleton spec file: rpmdev-newspec
rpmdev-newspec ocrad
[root@fedora SPECS]# ls
ocrad.spec

3. Edit the specfile
[root@fedora SPECS]# cat ocrad.spec
Name:      ocrad

Version:   0.20     
Release:21%{dist}      
Summary:ocrad package test         

License:free        
URL:http://www.gnu.org/software/ocrad/                              
Source0:  ocrad-0.20.tar.gz                  ocrad-0.20.tar.gz

BuildRequires:gettext
BuildRequires:automake
BuildRequires:autoconf
BuildRequires:libtool  

%description
%prep
%setup -q
%build
%configure
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
%files
%doc
%changelog

4. Attempt to build your package: rpmbuild -ba nameOfPackage.spec
Run
rpmbuild -ba ocrad.spec

Processing files: ocrad-0.20-10.fc16.x86_64
Processing files: ocrad-debuginfo-0.20-10.fc16.x86_64
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/ocrad-0.20-10.fc16.x86_64
error: Installed (but unpackaged) file(s) found:
   /usr/bin/ocrad
   /usr/include/ocradlib.h
   /usr/libexec/libocrad.a
   /usr/share/info/dir
   /usr/share/info/ocrad.info.gz
   /usr/share/man/man1/ocrad.1.gz

RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/bin/ocrad
   /usr/include/ocradlib.h
   /usr/libexec/libocrad.a
   /usr/share/info/dir
   /usr/share/info/ocrad.info.gz
   /usr/share/man/man1/ocrad.1.gz

Build from source lab

22 Jan

In my lab, i try to install two software, one is bash, another is ocrad
lab steps for install ocrad    
1. install development tools
    yum groupinstall “Development Tools” “Development Libraries”
2. Choose new packages – ocrad, download from http://www.gnu.org/software/ocrad/
    ocrad-0.20.tar.gz
3. unpack the tarball:
    tar ocrad-0.20.tar.gz
4.    run ./configure at ocrad-0.20 directory
    
    [root@fedora ocrad-0.20]# ./configure

creating config.status
creating Makefile
VPATH = .
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
datadir = $(prefix)/share
includedir = ${prefix}/include
infodir = $(datadir)/info
libdir = ${exec_prefix}/lib
mandir = $(datadir)/man
sysconfdir = $(prefix)/etc
CXX = g++
CPPFLAGS =
CXXFLAGS = -Wall -W -O2
LDFLAGS =
OK. Now you can run mak

5. Run a script to build the software (typically make)
[root@fedora ocrad-0.20]# time make
g++  -Wall -W -O2 -c -o common.o common.cc
g++  -Wall -W -O2 -c -o mask.o mask.cc
g++  -Wall -W -O2 -c -o rational.o rational.cc
g++  -Wall -W -O2 -c -o rectangle.o rectangle.cc
g++  -Wall -W -O2 -c -o track.o track.cc
g++  -Wall -W -O2 -c -o ucs.o ucs.cc
g++  -Wall -W -O2 -c -o page_image.o page_image.cc
g++  -Wall -W -O2 -c -o page_image_io.o page_image_io.cc
g++  -Wall -W -O2 -c -o bitmap.o bitmap.cc
g++  -Wall -W -O2 -c -o blob.o blob.cc
g++  -Wall -W -O2 -c -o profile.o profile.cc
g++  -Wall -W -O2 -c -o feats.o feats.cc
g++  -Wall -W -O2 -c -o feats_test0.o feats_test0.cc
g++  -Wall -W -O2 -c -o feats_test1.o feats_test1.cc
g++  -Wall -W -O2 -c -o character.o character.cc
g++  -Wall -W -O2 -c -o character_r11.o character_r11.cc
g++  -Wall -W -O2 -c -o character_r12.o character_r12.cc
g++  -Wall -W -O2 -c -o character_r13.o character_r13.cc
g++  -Wall -W -O2 -c -o textline.o textline.cc
g++  -Wall -W -O2 -c -o textline_r2.o textline_r2.cc
g++  -Wall -W -O2 -c -o textblock.o textblock.cc
g++  -Wall -W -O2 -c -o textpage.o textpage.cc
g++  -Wall -W -O2 -c -o arg_parser.o arg_parser.cc
g++  -Wall -W -O2 -DPROGVERSION=\”0.20\” -c -o main.o main.cc
g++  -o ocrad common.o mask.o rational.o rectangle.o track.o ucs.o page_image.o page_image_io.o bitmap.o blob.o profile.o feats.o feats_test0.o feats_test1.o character.o character_r11.o character_r12.o character_r13.o textline.o textline_r2.o textblock.o textpage.o arg_parser.o main.o
g++  -Wall -W -O2 -c -o ocradlib.o ocradlib.cc
ar -rcs libocrad.a common.o mask.o rational.o rectangle.o track.o ucs.o page_image.o page_image_io.o bitmap.o blob.o profile.o feats.o feats_test0.o feats_test1.o character.o character_r11.o character_r12.o character_r13.o textline.o textline_r2.o textblock.o textpage.o ocradlib.o

real    0m2.299s
user    0m0.324s
sys    0m0.203s

6. make install
[root@fedora ocrad-0.20]# make install
if [ ! -d “/usr/local/share/info” ] ; then install -d -m 755 “/usr/local/share/info” ; fi
install -p -m 644 ./doc/ocrad.info “/usr/local/share/info/ocrad.info”
install-info –info-dir=”/usr/local/share/info” “/usr/local/share/info/ocrad.info”
if [ ! -d “/usr/local/share/man/man1” ] ; then install -d -m 755 “/usr/local/share/man/man1” ; fi
install -p -m 644 ./doc/ocrad.1 “/usr/local/share/man/man1/ocrad.1”
if [ ! -d “/usr/local/bin” ] ; then install -d -m 755 “/usr/local/bin” ; fi
if [ ! -d “/usr/local/include” ] ; then install -d -m 755 “/usr/local/include” ; fi
if [ ! -d “/usr/local/lib” ] ; then install -d -m 755 “/usr/local/lib” ; fi
install -p -m 755 ./ocrad “/usr/local/bin/ocrad”
install -p -m 644 ./ocradlib.h “/usr/local/include/ocradlib.h”
install -p -m 644 ./libocrad.a “/usr/local/lib/libocrad.a”

Lab steps for install Bash

package 2 Bash
1. Download bash package from it’s website
http://www.gnu.org/software/bash/
bash-4.2.tar.gz

2. unzip it and run ./configure
3. time make
    ***********************************************************
      *                                                         *
      * GNU bash, version 4.2.0(1)-release (x86_64-unknown-linux-gnu)
      *                                                         *
      ***********************************************************

real    0m0.052s
user    0m0.031s
sys    0m0.012s

4. make install
[root@fedora bash-4.2]# make install

      ***********************************************************
      *                                                         *
      * GNU bash, version 4.2.0(2)-release (x86_64-unknown-linux-gnu)
      *                                                         *
      ***********************************************************

make[1]: Entering directory `/home/gli37/Downloads/bash-4.2/builtins’
make[1]: `libbuiltins.a’ is up to date.
make[1]: Leaving directory `/home/gli37/Downloads/bash-4.2/builtins’
( cd ./po/ ; make  DESTDIR= installdirs )
make[1]: Entering directory `/home/gli37/Downloads/bash-4.2/po’
/bin/sh /home/gli37/Downloads/bash-4.2/./support/mkinstalldirs /usr/local/share
if test “bash” = “gettext-tools”; then \
  /bin/sh /home/gli37/Downloads/bash-4.2/./support/mkinstalldirs /usr/local/share/gettext/po; \
else \
  : ; \
fi
make[1]: Leaving directory `/home/gli37/Downloads/bash-4.2/po’
/usr/bin/install -c -m 0755 bash /usr/local/bin/bash
/usr/bin/install -c -m 0555 bashbug /usr/local/bin/bashbug
( cd ./doc ; make  \
    man1dir=/usr/local/share/man/man1 man1ext=.1 \
    man3dir=/usr/local/share/man/man3 man3ext=.3 \
    infodir=/usr/local/share/info htmldir= DESTDIR= install )
make[1]: Entering directory `/home/gli37/Downloads/bash-4.2/doc’
/bin/sh ../support/mkinstalldirs /usr/local/share/man/man1
/bin/sh ../support/mkinstalldirs /usr/local/share/info
if test -n “” ; then \
    /bin/sh ../support/mkinstalldirs  ; \
fi
/usr/bin/install -c -m 644 ./bash.1 /usr/local/share/man/man1/bash.1
/usr/bin/install -c -m 644 ./bashbug.1 /usr/local/share/man/man1/bashbug.1
if test -f bash.info; then d=.; else d=.; fi; \
  /usr/bin/install -c -m 644 $d/bash.info /usr/local/share/info/bash.info
if /bin/sh -c ‘install-info –version’ >/dev/null 2>&1; then \
    install-info –dir-file=/usr/local/share/info/dir /usr/local/share/info/bash.info; \
else true; fi
if test -n “” ; then \
    /usr/bin/install -c -m 644 ./bash.html  ; \
    /usr/bin/install -c -m 644 ./bashref.html  ; \
fi
make[1]: Leaving directory `/home/gli37/Downloads/bash-4.2/doc’
( cd ./builtins ; make  DESTDIR= install )
make[1]: Entering directory `/home/gli37/Downloads/bash-4.2/builtins’
make[1]: Nothing to be done for `install’.
make[1]: Leaving directory `/home/gli37/Downloads/bash-4.2/builtins’
( cd ./po/ ; make  DESTDIR= install )
make[1]: Entering directory `/home/gli37/Downloads/bash-4.2/po’
/bin/sh /home/gli37/Downloads/bash-4.2/./support/mkinstalldirs /usr/local/share
installing en@quot.gmo as /usr/local/share/locale/en@quot/LC_MESSAGES/bash.mo
installing en@boldquot.gmo as /usr/local/share/locale/en@boldquot/LC_MESSAGES/bash.mo
installing af.gmo as /usr/local/share/locale/af/LC_MESSAGES/bash.mo
….
installing vi.gmo as /usr/local/share/locale/vi/LC_MESSAGES/bash.mo
installing zh_CN.gmo as /usr/local/share/locale/zh_CN/LC_MESSAGES/bash.mo
installing zh_TW.gmo as /usr/local/share/locale/zh_TW/LC_MESSAGES/bash.mo
if test “bash” = “gettext-tools”; then \
  /bin/sh /home/gli37/Downloads/bash-4.2/./support/mkinstalldirs /usr/local/share/gettext/po; \
  for file in Makefile.in.in remove-potcdate.sin quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot   Makevars.template; do \
    /usr/bin/install -c -m 644 ./$file \
            /usr/local/share/gettext/po/$file; \
  done; \
  for file in Makevars; do \
    rm -f /usr/local/share/gettext/po/$file; \
  done; \
else \
  : ; \
fi
make[1]: Leaving directory `/home/gli37/Downloads/bash-4.2/po’

Hello

17 Jan

My  name is Gang Li. I am just back from my second Coop term and currently studying CTY in my 5th semester. Frankly, I have no idea about the program SBR600, the reason that I chose this course is the professor Chris. Tyler. I took OPS335 on his class, and knew he is the best Linux/Unix teacher at Seneca.
Seneca Wiki User Page: http://zenit.senecac.on.ca/wiki/index.php/User:gli37
Fedora Wiki User Page: https://fedoraproject.org/wiki/User:gli37
IRC Nickname: bory
IRC
Learn ID: 044928091