Advertisement
beqa1923

Untitled

Aug 23rd, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. version="2.0.0"
  4. release="2"
  5. if ! which rpmbuild > /dev/null; then
  6. echo "Please install rpmbuild"
  7. exit
  8. else
  9. echo "got rpmbuild"
  10. fi
  11.  
  12. rootdir=$(pwd)
  13. rpmdir=$rootdir/rpmbuild
  14.  
  15. set -e
  16. ./clean.sh
  17.  
  18. cd libxutils
  19. make
  20.  
  21. cd ../libott
  22. make
  23.  
  24. cd ..
  25. make
  26.  
  27. cd $rootdir
  28.  
  29. mkdir -p $rpmdir/{RPMS,SRPMS,BUILD,SOURCES,SPECS}
  30.  
  31. mkdir -p $rpmdir/qpix-$version/{etc,usr}
  32.  
  33. mkdir -p $rpmdir/qpix-$version/usr/bin
  34.  
  35. mkdir -p $rpmdir/qpix-$version/usr/share/qpix/docs
  36.  
  37. mkdir -p $rpmdir/qpix-$version/etc/qpix/config
  38.  
  39. install -m 644 qpix.json $rpmdir/qpix-$version/etc/qpix/config
  40.  
  41. install -m 644 $rootdir/doc/QpixUserManual.pdf $rpmdir/qpix-$version/usr/share/qpix/docs/
  42.  
  43. install -m 755 qpix $rpmdir/qpix-$version/usr/bin/
  44.  
  45. echo "%define __spec_install_post %{nil}
  46. %define _tmppath %{_topdir}/tmp
  47.  
  48. Summary: Qarva PIX server
  49. Name: qpix
  50. Version: "$version"
  51. Release: "$release"
  52. License: GPL
  53. URL: http://gitlab.qrv/chiqovani/qarva-pix-server
  54. Packager: Qarva
  55. Source0: %{name}-%{version}.tar.gz
  56. BuildRequires: ffmpeg-devel
  57. BuildRequires: libcrypt
  58.  
  59. %description
  60. Qarva PIX server
  61.  
  62. %setup -n
  63.  
  64. %build
  65.  
  66.  
  67. %install
  68. rm -rf %{buildroot}
  69. mkdir -p %{buildroot}
  70.  
  71.  
  72. cp -a $rpmdir/qpix-$version/etc %{buildroot}
  73. cp -a $rpmdir/qpix-$version/usr %{buildroot}
  74.  
  75.  
  76. %clean
  77. rm -rf %{buildroot}
  78.  
  79. %files
  80. %config(noreplace) /etc/qpix/config/qpix.json
  81. /usr/bin/qpix
  82. /usr/share/qpix/docs/QpixUserManual.pdf
  83.  
  84.  
  85. " > $rpmdir/SPECS/qpix.spec
  86. cd $rpmdir
  87. tar czvf SOURCES/qpix-$version.tar.gz qpix-$version
  88. rpmbuild -bb SPECS/qpix.spec --define '_topdir '${PWD}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement