Creating a terminal application from a shell script











up vote
2
down vote

favorite
2












I have a shell script. I want to convert the shell script to an application for Ubuntu which can be installed using (sudo apt-get install) command and after installing, the application can run from the terminal by typing the name of the application.










share|improve this question




















  • 4




    Depending on what you're doing, either developer.ubuntu.com or debian.org/doc/manuals/developers-reference (yes, that's a Debian link, I don't believe Ubuntu has its own version, you can skim over a lot of sections about internal Debian stuff).
    – derobert
    Apr 4 '13 at 17:17












  • Just to make sure, is your intention to package your script just to be able to run it "from the terminal by typing the name"?
    – Adrian Frühwirth
    Apr 6 '13 at 18:07















up vote
2
down vote

favorite
2












I have a shell script. I want to convert the shell script to an application for Ubuntu which can be installed using (sudo apt-get install) command and after installing, the application can run from the terminal by typing the name of the application.










share|improve this question




















  • 4




    Depending on what you're doing, either developer.ubuntu.com or debian.org/doc/manuals/developers-reference (yes, that's a Debian link, I don't believe Ubuntu has its own version, you can skim over a lot of sections about internal Debian stuff).
    – derobert
    Apr 4 '13 at 17:17












  • Just to make sure, is your intention to package your script just to be able to run it "from the terminal by typing the name"?
    – Adrian Frühwirth
    Apr 6 '13 at 18:07













up vote
2
down vote

favorite
2









up vote
2
down vote

favorite
2






2





I have a shell script. I want to convert the shell script to an application for Ubuntu which can be installed using (sudo apt-get install) command and after installing, the application can run from the terminal by typing the name of the application.










share|improve this question















I have a shell script. I want to convert the shell script to an application for Ubuntu which can be installed using (sudo apt-get install) command and after installing, the application can run from the terminal by typing the name of the application.







shell ubuntu






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 25 at 22:49









Rui F Ribeiro

38.3k1477127




38.3k1477127










asked Apr 4 '13 at 17:07









rohangulati

111




111








  • 4




    Depending on what you're doing, either developer.ubuntu.com or debian.org/doc/manuals/developers-reference (yes, that's a Debian link, I don't believe Ubuntu has its own version, you can skim over a lot of sections about internal Debian stuff).
    – derobert
    Apr 4 '13 at 17:17












  • Just to make sure, is your intention to package your script just to be able to run it "from the terminal by typing the name"?
    – Adrian Frühwirth
    Apr 6 '13 at 18:07














  • 4




    Depending on what you're doing, either developer.ubuntu.com or debian.org/doc/manuals/developers-reference (yes, that's a Debian link, I don't believe Ubuntu has its own version, you can skim over a lot of sections about internal Debian stuff).
    – derobert
    Apr 4 '13 at 17:17












  • Just to make sure, is your intention to package your script just to be able to run it "from the terminal by typing the name"?
    – Adrian Frühwirth
    Apr 6 '13 at 18:07








4




4




Depending on what you're doing, either developer.ubuntu.com or debian.org/doc/manuals/developers-reference (yes, that's a Debian link, I don't believe Ubuntu has its own version, you can skim over a lot of sections about internal Debian stuff).
– derobert
Apr 4 '13 at 17:17






Depending on what you're doing, either developer.ubuntu.com or debian.org/doc/manuals/developers-reference (yes, that's a Debian link, I don't believe Ubuntu has its own version, you can skim over a lot of sections about internal Debian stuff).
– derobert
Apr 4 '13 at 17:17














Just to make sure, is your intention to package your script just to be able to run it "from the terminal by typing the name"?
– Adrian Frühwirth
Apr 6 '13 at 18:07




Just to make sure, is your intention to package your script just to be able to run it "from the terminal by typing the name"?
– Adrian Frühwirth
Apr 6 '13 at 18:07










1 Answer
1






active

oldest

votes

















up vote
1
down vote













Packaging a binary or script is very simple. In the most trivial case, you need a .deb package which contains a copy of your binary in usr/bin/yourbinary. However, there are a number of things you should take care of if you want others to find it usable.



In concrete terms, have a look at the package dh-make, which contains all the infrastructure you need to create a well-behaved Debian package.



When you run dh_make -s -n in the directory where you develop your script, you get to fill in some details, such as a package description and your name and email address. The tool will create a debian/ directory with some template files which you should either modify or remove. (The ones with *.ex names are probably all good to remove.)



(dh_make is particular about the directory name; it will print an error message directing you to use dh_make -s -n -p yourpackage_0.01 to proceed without renaming the directory.)




  • The package should have a useful name and a description. This is in the debian/control file. This is also where you can make it depend on other packages, or even particular versions of other packages.

  • There needs to be a modicum of documentation; the files debian/README and debian/changelog should be updated to contain more than just the boilerplate. If you have notes for the package itself, you might want to put them in debian/README.Debian; otherwise, delete this file. Similar for debian/README.source, i.e. notes for somebody downloading the package's sources with apt-get source yourpackage. These files will end up in /usr/share/doc/yourpackage when you install yourpackage. If you want to put other files there, add their names to the (now empty) text file debian/docs. Otherwise, you can delete this file, too.

  • Review debian/copyright and update it if necessary. This too will end up in /usr/share/doc/yourpackage.


There is a wealth of material about Debian packaging and dh-make all over the Internet; this answer is obviously very brief and summaric. For a really proper package, you need to read and understand all of the Debian Policy.






share|improve this answer























  • For a single script, you might also look at equivs, which however is more oriented towards creating an empty meta-package which pulls in other packages as dependencies. It does have a facility for including arbitrary files in the package as well, though. The instructions are less oriented towards actually packaging something, but once you understand the basics of dh_make you might want to use just a single source file for the entire package, which equivs does for you (it basically offers a superset of the debian/control file for controlling the entire package).
    – tripleee
    Jun 6 '13 at 8:12










  • To publish the package so that apt-get finds it, you need to set up a repo, and add the repo's URL to a file in /etc/apt/sources.list.d; some package managers also provide a GUI for this. If a public repo is acceptable, Launchpad offers to host a PPA for you, but setting up a private repo isn't too hard, either; you basically need to run dpkg-scanpackages to generate the Packages file.
    – tripleee
    Jul 10 '13 at 5:37











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f71213%2fcreating-a-terminal-application-from-a-shell-script%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













Packaging a binary or script is very simple. In the most trivial case, you need a .deb package which contains a copy of your binary in usr/bin/yourbinary. However, there are a number of things you should take care of if you want others to find it usable.



In concrete terms, have a look at the package dh-make, which contains all the infrastructure you need to create a well-behaved Debian package.



When you run dh_make -s -n in the directory where you develop your script, you get to fill in some details, such as a package description and your name and email address. The tool will create a debian/ directory with some template files which you should either modify or remove. (The ones with *.ex names are probably all good to remove.)



(dh_make is particular about the directory name; it will print an error message directing you to use dh_make -s -n -p yourpackage_0.01 to proceed without renaming the directory.)




  • The package should have a useful name and a description. This is in the debian/control file. This is also where you can make it depend on other packages, or even particular versions of other packages.

  • There needs to be a modicum of documentation; the files debian/README and debian/changelog should be updated to contain more than just the boilerplate. If you have notes for the package itself, you might want to put them in debian/README.Debian; otherwise, delete this file. Similar for debian/README.source, i.e. notes for somebody downloading the package's sources with apt-get source yourpackage. These files will end up in /usr/share/doc/yourpackage when you install yourpackage. If you want to put other files there, add their names to the (now empty) text file debian/docs. Otherwise, you can delete this file, too.

  • Review debian/copyright and update it if necessary. This too will end up in /usr/share/doc/yourpackage.


There is a wealth of material about Debian packaging and dh-make all over the Internet; this answer is obviously very brief and summaric. For a really proper package, you need to read and understand all of the Debian Policy.






share|improve this answer























  • For a single script, you might also look at equivs, which however is more oriented towards creating an empty meta-package which pulls in other packages as dependencies. It does have a facility for including arbitrary files in the package as well, though. The instructions are less oriented towards actually packaging something, but once you understand the basics of dh_make you might want to use just a single source file for the entire package, which equivs does for you (it basically offers a superset of the debian/control file for controlling the entire package).
    – tripleee
    Jun 6 '13 at 8:12










  • To publish the package so that apt-get finds it, you need to set up a repo, and add the repo's URL to a file in /etc/apt/sources.list.d; some package managers also provide a GUI for this. If a public repo is acceptable, Launchpad offers to host a PPA for you, but setting up a private repo isn't too hard, either; you basically need to run dpkg-scanpackages to generate the Packages file.
    – tripleee
    Jul 10 '13 at 5:37















up vote
1
down vote













Packaging a binary or script is very simple. In the most trivial case, you need a .deb package which contains a copy of your binary in usr/bin/yourbinary. However, there are a number of things you should take care of if you want others to find it usable.



In concrete terms, have a look at the package dh-make, which contains all the infrastructure you need to create a well-behaved Debian package.



When you run dh_make -s -n in the directory where you develop your script, you get to fill in some details, such as a package description and your name and email address. The tool will create a debian/ directory with some template files which you should either modify or remove. (The ones with *.ex names are probably all good to remove.)



(dh_make is particular about the directory name; it will print an error message directing you to use dh_make -s -n -p yourpackage_0.01 to proceed without renaming the directory.)




  • The package should have a useful name and a description. This is in the debian/control file. This is also where you can make it depend on other packages, or even particular versions of other packages.

  • There needs to be a modicum of documentation; the files debian/README and debian/changelog should be updated to contain more than just the boilerplate. If you have notes for the package itself, you might want to put them in debian/README.Debian; otherwise, delete this file. Similar for debian/README.source, i.e. notes for somebody downloading the package's sources with apt-get source yourpackage. These files will end up in /usr/share/doc/yourpackage when you install yourpackage. If you want to put other files there, add their names to the (now empty) text file debian/docs. Otherwise, you can delete this file, too.

  • Review debian/copyright and update it if necessary. This too will end up in /usr/share/doc/yourpackage.


There is a wealth of material about Debian packaging and dh-make all over the Internet; this answer is obviously very brief and summaric. For a really proper package, you need to read and understand all of the Debian Policy.






share|improve this answer























  • For a single script, you might also look at equivs, which however is more oriented towards creating an empty meta-package which pulls in other packages as dependencies. It does have a facility for including arbitrary files in the package as well, though. The instructions are less oriented towards actually packaging something, but once you understand the basics of dh_make you might want to use just a single source file for the entire package, which equivs does for you (it basically offers a superset of the debian/control file for controlling the entire package).
    – tripleee
    Jun 6 '13 at 8:12










  • To publish the package so that apt-get finds it, you need to set up a repo, and add the repo's URL to a file in /etc/apt/sources.list.d; some package managers also provide a GUI for this. If a public repo is acceptable, Launchpad offers to host a PPA for you, but setting up a private repo isn't too hard, either; you basically need to run dpkg-scanpackages to generate the Packages file.
    – tripleee
    Jul 10 '13 at 5:37













up vote
1
down vote










up vote
1
down vote









Packaging a binary or script is very simple. In the most trivial case, you need a .deb package which contains a copy of your binary in usr/bin/yourbinary. However, there are a number of things you should take care of if you want others to find it usable.



In concrete terms, have a look at the package dh-make, which contains all the infrastructure you need to create a well-behaved Debian package.



When you run dh_make -s -n in the directory where you develop your script, you get to fill in some details, such as a package description and your name and email address. The tool will create a debian/ directory with some template files which you should either modify or remove. (The ones with *.ex names are probably all good to remove.)



(dh_make is particular about the directory name; it will print an error message directing you to use dh_make -s -n -p yourpackage_0.01 to proceed without renaming the directory.)




  • The package should have a useful name and a description. This is in the debian/control file. This is also where you can make it depend on other packages, or even particular versions of other packages.

  • There needs to be a modicum of documentation; the files debian/README and debian/changelog should be updated to contain more than just the boilerplate. If you have notes for the package itself, you might want to put them in debian/README.Debian; otherwise, delete this file. Similar for debian/README.source, i.e. notes for somebody downloading the package's sources with apt-get source yourpackage. These files will end up in /usr/share/doc/yourpackage when you install yourpackage. If you want to put other files there, add their names to the (now empty) text file debian/docs. Otherwise, you can delete this file, too.

  • Review debian/copyright and update it if necessary. This too will end up in /usr/share/doc/yourpackage.


There is a wealth of material about Debian packaging and dh-make all over the Internet; this answer is obviously very brief and summaric. For a really proper package, you need to read and understand all of the Debian Policy.






share|improve this answer














Packaging a binary or script is very simple. In the most trivial case, you need a .deb package which contains a copy of your binary in usr/bin/yourbinary. However, there are a number of things you should take care of if you want others to find it usable.



In concrete terms, have a look at the package dh-make, which contains all the infrastructure you need to create a well-behaved Debian package.



When you run dh_make -s -n in the directory where you develop your script, you get to fill in some details, such as a package description and your name and email address. The tool will create a debian/ directory with some template files which you should either modify or remove. (The ones with *.ex names are probably all good to remove.)



(dh_make is particular about the directory name; it will print an error message directing you to use dh_make -s -n -p yourpackage_0.01 to proceed without renaming the directory.)




  • The package should have a useful name and a description. This is in the debian/control file. This is also where you can make it depend on other packages, or even particular versions of other packages.

  • There needs to be a modicum of documentation; the files debian/README and debian/changelog should be updated to contain more than just the boilerplate. If you have notes for the package itself, you might want to put them in debian/README.Debian; otherwise, delete this file. Similar for debian/README.source, i.e. notes for somebody downloading the package's sources with apt-get source yourpackage. These files will end up in /usr/share/doc/yourpackage when you install yourpackage. If you want to put other files there, add their names to the (now empty) text file debian/docs. Otherwise, you can delete this file, too.

  • Review debian/copyright and update it if necessary. This too will end up in /usr/share/doc/yourpackage.


There is a wealth of material about Debian packaging and dh-make all over the Internet; this answer is obviously very brief and summaric. For a really proper package, you need to read and understand all of the Debian Policy.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jun 6 '13 at 8:09

























answered Jun 6 '13 at 7:35









tripleee

4,91911727




4,91911727












  • For a single script, you might also look at equivs, which however is more oriented towards creating an empty meta-package which pulls in other packages as dependencies. It does have a facility for including arbitrary files in the package as well, though. The instructions are less oriented towards actually packaging something, but once you understand the basics of dh_make you might want to use just a single source file for the entire package, which equivs does for you (it basically offers a superset of the debian/control file for controlling the entire package).
    – tripleee
    Jun 6 '13 at 8:12










  • To publish the package so that apt-get finds it, you need to set up a repo, and add the repo's URL to a file in /etc/apt/sources.list.d; some package managers also provide a GUI for this. If a public repo is acceptable, Launchpad offers to host a PPA for you, but setting up a private repo isn't too hard, either; you basically need to run dpkg-scanpackages to generate the Packages file.
    – tripleee
    Jul 10 '13 at 5:37


















  • For a single script, you might also look at equivs, which however is more oriented towards creating an empty meta-package which pulls in other packages as dependencies. It does have a facility for including arbitrary files in the package as well, though. The instructions are less oriented towards actually packaging something, but once you understand the basics of dh_make you might want to use just a single source file for the entire package, which equivs does for you (it basically offers a superset of the debian/control file for controlling the entire package).
    – tripleee
    Jun 6 '13 at 8:12










  • To publish the package so that apt-get finds it, you need to set up a repo, and add the repo's URL to a file in /etc/apt/sources.list.d; some package managers also provide a GUI for this. If a public repo is acceptable, Launchpad offers to host a PPA for you, but setting up a private repo isn't too hard, either; you basically need to run dpkg-scanpackages to generate the Packages file.
    – tripleee
    Jul 10 '13 at 5:37
















For a single script, you might also look at equivs, which however is more oriented towards creating an empty meta-package which pulls in other packages as dependencies. It does have a facility for including arbitrary files in the package as well, though. The instructions are less oriented towards actually packaging something, but once you understand the basics of dh_make you might want to use just a single source file for the entire package, which equivs does for you (it basically offers a superset of the debian/control file for controlling the entire package).
– tripleee
Jun 6 '13 at 8:12




For a single script, you might also look at equivs, which however is more oriented towards creating an empty meta-package which pulls in other packages as dependencies. It does have a facility for including arbitrary files in the package as well, though. The instructions are less oriented towards actually packaging something, but once you understand the basics of dh_make you might want to use just a single source file for the entire package, which equivs does for you (it basically offers a superset of the debian/control file for controlling the entire package).
– tripleee
Jun 6 '13 at 8:12












To publish the package so that apt-get finds it, you need to set up a repo, and add the repo's URL to a file in /etc/apt/sources.list.d; some package managers also provide a GUI for this. If a public repo is acceptable, Launchpad offers to host a PPA for you, but setting up a private repo isn't too hard, either; you basically need to run dpkg-scanpackages to generate the Packages file.
– tripleee
Jul 10 '13 at 5:37




To publish the package so that apt-get finds it, you need to set up a repo, and add the repo's URL to a file in /etc/apt/sources.list.d; some package managers also provide a GUI for this. If a public repo is acceptable, Launchpad offers to host a PPA for you, but setting up a private repo isn't too hard, either; you basically need to run dpkg-scanpackages to generate the Packages file.
– tripleee
Jul 10 '13 at 5:37


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f71213%2fcreating-a-terminal-application-from-a-shell-script%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Morgemoulin

Scott Moir

Souastre