Apt/compatibility

From Minux Wiki
Jump to navigation Jump to search

to design an app for use trough apt, you do need to create one file and one folder in specific locations, these files will tell apt how to install your software.

Information on how to set up a repository server can be found here


manifest and repository idea

on the primary apt repository, in https://minux.vtchost.com/apt/ you will find 2 main folders, one called "manifest" and the other "repository".

the manifest contains the file lists and version data, these tell apt what files to search for and install and when to update. the repository contains the actual files that will be installed on the computers.

program files can be found on the server in /repository/appname/ where appname is the program name, this location on the repository will be treated as if it's the system root (/) when "appname" is requested.

from here we follow the normal file structure, by adhering to the general file structure you can avoid clutter and overwriting files of other programs.

anything other then putting the files in the right location and adding them to the manifest, everything else is optional, tough i would read trough them to see if they might be usefull to you.


General file structure

please follow these simple rules to avoid conflicts with other programs and make it all make sense to the users, you'd like to have a neat computer, right? so play nice please.

- /

Root folder. please refrain from putting files here to avoid clutter

- /bin

This location is used for "binaries", the starter files of your programs. files in this location are intended to be run by the users.

it is advised (but not required)to use the extention ".sh" for files in this location, indicating to the users it's a program meant to be run directly.

binaries are installed in /bin directly for an easy overview

- /gbin

the same as bin but for programs intended to be run from a GUI, they ask for the required input rather then expect it.

- /etc

this location is used to install the actual applications, any file used by a program that isn't mean to be run directly should be here.

some programs will also store configuration files in this location.

programs should store their files in their own folder, eg: "/etc/apt/" or "/etc/netfolder/"

- /usr

used to store user data and sometimes configuration data, this is where information is saved, no executable programs should ever be placed here.

when uninstalling, this folder will be mostly ignored, saving user data.

programs should store data in their own folder, eg: "/usr/apt/"

- /boot

files in this location are associated with the bootup process, they are stored in a seperate location for maintenance/debug purpuses

if a system fails to boot up, 9/10 the problem will be somewhere in this folder.

any file required to boot up a system should be placed here.

- /temp

the temporary files folder, used by programs as temporary storage.


Installation and updating:

- manifest file file list, REQUIRED

the manifest file tells apt what files to look for and where. your program needs such a manifest.

this is a file located on the apt server in /manifest/appname.db where appname is your program's name, use extention ".db"

the file always starts with the first line containing "AIF", this is to catch "error 404 - page not found" when the app isn't found.

after the "AIF" line, add the files with full path as they appear on your system. examples can be found here.

eg: on your CC computer, the file "/bin/apt.sh" wich is a part of minux-main is located on the repository on "/repository/minux-main/bin/apt.sh",

in the manifest file we write it as it is on the CC computer, so "/bin/apt.sh", apt will add the "/repository/minux-main/" itself.

make sure your manifest file has the same name (without extention) as your repository folder has, eg: "/manifest/foo.db" looks in "/repository/foo/"


-Version file - regulates updates (OPTIONAL)

this file is used to trigger updates. any time a user runs "apt -u" apt will check the version number and if there is a mismatch update said program.

should you change the verion number this will in effect trigger an update to every system with this app installed.

these files are found in /manifest/version/appname.ve where appname is your program's name, use ".ve" extention.

it's intended to put the version number in this file, tough in practice any number can be used and any change will trigger an update.

this file does NOT need to be added to the manifest file but placed directly in the folder "/manifest/version/"


-Dependency file auto install other software(OPTIONAL)

apt looks for a file called "yourapp.dep" wich should be right next to the manifest file in /apt/manifest/ on the repository, this file is used to mark other programs as a dependency of yours, making their installation a requirement before yours gets installed.

the file MUST start with the line ADF to mark this file as an "apt dependency file", this is to catch error 404 from webservers.

after that, name the programs that you want to be installed alongside yours, one program per line. an example can be found here


-alias file set system aliases/commands or load api's on boot (OPTIONAL)

this file is used to create system "alias" shortcuts, eg: the command "apt" translates to "/bin/apt.sh", this is handled by the Alias file.

apt will look for and include any file in the location /etc/apt/alias/appname.al where appname is your program's name.

an example of such a file can be found here, multiple lines are possible, an example can be found here

when apt sees this file, it will read it's contents and add it to /boot/alias.ls, when you remove an app it will also rebuild this file but without the removed app.

this allows you to create your own system commands associated with your apps.

this file needs to be added to the manifest file.


-uninstall cleanup delete additional files (OPTIONAL)

when uninstalling a program, you sometimes want to delete files that were generated in stead of downloaded, with this you can give additional uninstall instructions.

create a list of files (absolute path!) with extention .db that you want removed and those will be deleted as well, there is no need to add files already in the manifest.

place this list in "/etc/apt/cleanup/", add this file to the manifest.


-Manual file include a manual (OPTIONAL)

the "man" program will look for it's files in /etc/man/, a file in this location called "test.man" can be opened with man using the command "man test"

to create a manual that "man" can use, simple place it in /etc/man/appname.man where appname is the name of your app.

doing this will include your application's manual in the "man" program making it easy for users to find.

a manual is just a text file, nothing more, there's nothing special about it.

this files needs to be added to the manifest file.


-server bootup service boot in another window (OPTIONAL) - requires advanced computer

Minux will look for the file /etc/server.sys and run it in a new tab (advanced computers only!), whatever is in this file will be run on system in a seperate window.

you can use this to run a dedicated server or device that will launch in a seperate windows without needing to login.

when the new session ends, it closes the window. the primary window remains a regular shell, including login prompt.

this is intended to be used for dedicated servers or device services running in the background 24/7.

obviously adding this file will conflict with any application that also uses this file, eg:dhcp-server.

this file needs to be added to the manifest file.


-pre-login bootup configuration boot before login (OPTIONAL)

when installing, removing or updating an app, apt will look in the directory /etc/apt/boot/, any file in this folder will be read and added to /boot/addon.d wich will be run on system startup.

adding this file in your program with the commands needed for bootup settings (pre-login), whatever program you run trough this, make sure it ends, the system won't finish booting if your program won't finish running, unless of course that is your intention, but this can conflict with other software.

as many programs can add a file to this folder as they want, this file needs to be added to the manifest


-post login bootup configuration boot after login (OPTIONAL)

when finished booting, just before dropping the user in a shell, minux will check to see if it can find the file "/boot/override.d", if it does it will run this in stead.

when this program finishes or crashes, minux will drop into a regular shell, if you want it to reboot at the end you'll have to make that happen yourself.

this is meant for programs that are supposed to always run, eg: another shell, GUI, or device interface. it will run after the user logged in.

this file needs to be added to the manifest