Практика сборки пакета

  1. Полный цикл сборки пакета из upstream (практика)
    • hsh-useradd george; relogin
    • .rpmmacros

      %_topdir        %homedir/RPM
      %_tmppath       %homedir/tmp
      
      %packager       Fr. Br. George <george@altlinux.ru>
      %_gpg_name      George V. Kouryachy (Fr. Br. George) <george@altlinux.ru>
    • /etc/hasher-priv/system

       prefix=~:/tmp 

    • .hasher/config

       def_repo=$HOME/repo 

    • .gitconfig
         [user]
                  email = george@altlinux.org
                  name = Fr. Br. George
    • nibbles: http://rpm.pbone.net/index.php3?stat=3&search=nibbles*src.rpm

    • george@arnor:~/git/nibbles> git init
      Initialized empty Git repository in /srv/git/nibbles/.git/
      george@arnor:~/git/nibbles> gear-srpmimport ~/Downloads/nibbles-0.0.4-6.src.rpm 
      george@arnor:~/git/nibbles> cleanup_spec nibbles.spec
    • diff --git a/nibbles.spec b/nibbles.spec
      index 7b77bbb..69ffafe 100644
      --- a/nibbles.spec
      +++ b/nibbles.spec
      @@ -1,8 +1,7 @@
      -# $Revision: 1.13 $, $Date: 2002/02/15 22:40:04 $
       Summary: NCurses based nibbles game
       Name: nibbles
       Version: 0.0.4
      -Release: 6
      +Release: alt1
       License: GPL
       Vendor: Project Purple ( http://www.earth.li/projectpurple/ )
       Group: Applications/Games
      @@ -25,7 +24,7 @@ ncurses one to learn how.
       %patch2 -p1
       
       %build
      -%__make CFLAGS="%rpmcflags" LDFLAGS="%rpmldflags" DATADIR=%_datadir
      +make DATADIR=%_datadir
       
       %install
       install -d $RPM_BUILD_ROOT{%_bindir,%_datadir/games,/var/games}
      @@ -34,13 +33,11 @@ install nibbles $RPM_BUILD_ROOT%_bindir
       touch $RPM_BUILD_ROOT/var/games/nibbles.score
       cp -a nibbles.levels $RPM_BUILD_ROOT%_datadir/games
       
      -gzip -9nf README TODO HISTORY CREDITS example.nibblerc
      -
       %files
       %defattr(644,root,root,755)
      -%attr(2755,root,games) %_bindir/nibbles
      +%attr(2711,root,games) %_bindir/nibbles
       %attr(664,root,games) %config(noreplace) %verify(not size mtime md5) /var/games/nibbles
       %_datadir/games/nibbles.levels
      -%doc *.gz
      +%doc README TODO HISTORY CREDITS example.nibblerc
       
       %changelog
    • diff --git a/nibbles.spec b/nibbles.spec
      index 5c09658..d9d9f99 100644
      --- a/nibbles.spec
      +++ b/nibbles.spec
      @@ -10,7 +10,7 @@ Patch0: %name-Makefile.patch
      -Group: Applications/Games
      +Group: Games/Arcade
       Patch1: %name-window.patch
       Patch2: %name-score.patch
       Url: http://www.earth.li/projectpurple/progs/nibbles.html
      -BuildRequires: ncurses-devel >= 5.0
      +Packager: Fr. Br. George <george@altlinux.ru>
       
       %description
       Nibbles is a remake of the classic Snake/Nibbles game in ncurses. I am
    •  george@arnor:~/git/nibbles> add_changelog -e "- Initial build from PLD" *spec 

    •  george@arnor:~/git/nibbles> gear-commit -a 

    •  george@arnor:~/git/nibbles> gear -v --hasher -- hsh --lazy |& tee ~/tmp/.log 

    •  george@arnor:~/git/nibbles> hsh-install libncursesw-devel 

    •  gear -v --hasher -- hsh-rebuild |& tee ~/tmp/.log 

    • diff --git a/nibbles-Makefile.patch b/nibbles-Makefile.patch
      index 7637e20..f4c1c84 100644
      --- a/nibbles-Makefile.patch
      +++ b/nibbles-Makefile.patch
      @@ -22,7 +22,7 @@ diff -Naur nibbles-v0.0.4/Makefile nibbles-v0.0.4-patched/Makefile
        
        nibbles: $(OBJS)
       -      $(CC) $(LIBS) $(OBJS)  -o $@
      -+      $(CC) $(LIBS) $(OBJS) $(LDFLAGS) -o $@
      ++      $(CC) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
        
        clean: 
              rm -f *~ *.o nibbles
    •  george@arnor:~/git/nibbles> git commit -a --amend 

    •  george@arnor:~/git/nibbles> find ~/hasher/chroot/usr/src/tmp/nibbles-buildroot 

    •  george@arnor:~/git/nibbles> hsh-install rpm-utils 

    •  george@arnor:~/git/nibbles> hsh-run buildreq "/usr/src/RPM/SPECS/nibbles.spec" 

    •  george@arnor:~/git/nibbles> cp ~/hasher/chroot/usr/src/RPM/SPECS/* . 

    •  george@arnor:~/git/nibbles> git commit -a --amend 

    •  george@arnor:~/git/nibbles> gear -v --hasher -- hsh --lazy |& tee ~/tmp/.log 

    • /etc/apt/sources.list

       rpm file:/home/george/repo x86_64 hasher 

    • на git.alt
    • подпись,тег и прочее


CategoryUneex CategoryLectures CategorySpecCourse CategoryCmc