Advertisement
metalx1000

Create Debian Deb Package

Jul 16th, 2014
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.03 KB | None | 0 0
  1. #!/bin/bash
  2. #creates a basic deb package for script file
  3.  
  4. echo "what is your email address?"
  5. read mail
  6. export DEBEMAIL="$mail"
  7.  
  8. echo "what is your name"
  9. read name
  10. export DEBFULLNAME="$name"
  11.  
  12. echo "What is your package name?"
  13. read package
  14.  
  15. echo "What is the version?"
  16. read ver
  17.  
  18. echo "What License do you want to use(example: gpl3)?"
  19. read license
  20.  
  21. folder="$package-$ver"
  22.  
  23. mkdir "$folder"
  24. cd "$folder"
  25. dh_make --createorig --copyright $license --indep # this will prompt you to hit enter
  26. mkdir essentials
  27. mv debian/{changelog,compat,rules,control} essentials
  28. rm -r debian
  29. mv essentials debian
  30. echo './example-src/* ./' > debian/$package.install
  31. mkdir -p example-src/usr/bin
  32.  
  33. echo "What is the name of your script?"
  34. read script
  35. vim example-src/usr/bin/$script # create the empty file to be installed
  36. chmod +x example-src/usr/bin/$script
  37.  
  38. vim debian/control
  39.  
  40. echo "Press 'Enter' to package now."
  41. read
  42.  
  43. dpkg-buildpackage -uc -tc -rfakeroot
  44. dpkg --contents ../$package_$ver_all.deb # inspect the resulting Debian package
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement