Sign in Join
Wiki copytemporary

Online Package Manager: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Online Package Manager

OldNewLine
1+## About
2+
3+Online Package Manager(OPM) is a tool that automates the process of installing, upgrading, configuring Lazarus packages. The packages are stored in the main repository(see repository column) as zip files, along with a [[JSON]] file. The JSON contains all necessary information about the packages. On request the packages are downloaded/extracted/compiled/installed into the IDE. If available, it's also possible to update a previously installed package from the maintainer webpage(see update column). There's also a web version of the Lazarus Packages Repository available here: <http://packages.lazarus-ide.org/>.
4+
5+<span style="color:red">**Please note:**</span>
6+
7+OPM reads the package description from the lpk file. I can understand that the description of many packages is very minimalistic or even non-existent, but there is nothing I can do about it. It's not OK to modify package description or any other property for that matter, without the consent of the package developer. More over testing each and every package, then write a detailed description is not realistic.
8+
9+### Screenshot
10+
11+<figure>
12+<img src="OPM6.png" title="OPM6.png" />
13+<figcaption>OPM6.png</figcaption>
14+</figure>
15+
16+<figure>
17+<img src="OPM7.png" title="OPM7.png" />
18+<figcaption>OPM7.png</figcaption>
19+</figure>
20+
21+### License
22+
23+[GNU General Public License](https://opensource.org/licenses/gpl-license)
24+
25+### Download
26+
27+Online package manager is part of Lazarus sources, in directory (\$LazarusDir)/components/onlinepackagemanager.
28+
29+### System Requirements / Dependencies
30+
31+- FPC 3.0.0 or newer
32+- Lazarus 1.8 or newer
33+- You can download an older version for the 1.6 series: [OPM 1.6](https://drive.google.com/open?id=0B9Me_c5onmWobVZOdVlXSlZRRmc)
34+- These versions were available at the time of writing this update.
35+- Tested on the following widgeset: win32/64, gtk2, carbon, qt(win)
36+- The package manager does not depend on any external package
37+
38+### Installation
39+
40+In Lazarus "Install/Uninstall Packages" window select "OnlinePackageManager" from the available packages, click "Install selection" and then rebuild the IDE.
41+
42+### Support page
43+
44+<http://forum.lazarus.freepascal.org/index.php/topic,34297.0.html>
45+
46+## Using the package manager
47+
48+### Getting started
49+
50+Go to Lazarus Menu--\>Package--\>Online Package Manager(Shortcut key: <span class="kbd">Ctrl</span>+<span class="kbd">Alt</span>+<span class="kbd">Shift</span>+<span class="kbd">O</span>). On startup the package manager will automatically download a list with available repository packages, the list is displayed in a tree(see screenshots above).
51+
52+### Filter the tree/Locate a package
53+
54+<figure>
55+<img src="OPM3.png" title="OPM3.png" />
56+<figcaption>OPM3.png</figcaption>
57+</figure>
58+
59+You can filter the package list by:
60+
61+- Packagename
62+- Package file(.lpk)--\>a repository package can contain multiple lpk files
63+- Package category
64+- Package status
65+- Version
66+- Description
67+- Author
68+- Lazarus compatibility
69+- FPC compatibility
70+- Supported widget sets
71+- Packagetype
72+- Dependencies
73+- License
74+
75+### Operation with packages
76+
77+<figure>
78+<img src="OPM4.png" title="OPM4.png" />
79+<figcaption>OPM4.png</figcaption>
80+</figure>
81+
82+#### Refresh package list
83+
84+Press the "Refresh" button to update the package list.
85+
86+#### Download package
87+
88+Check one or more package then press the "Download" button. This will download/extract the packages to a preselected directory. Nothing gets installed. Useful when you want to install the packages manually or study their sources without installing.
89+
90+#### Install a package
91+
92+Check one or more package then press the "Install" button. The package manager will automatically download/extract/compile/install the selected packages(from the main repository), then rebuild the IDE if necessary(Designtime/Designtime_and_runtime packages). Confirm the rebuild by clicking the "Yes" button. Please note: The compile feature is only available in Lazarus 1.7+.
93+
94+#### Update a package
95+
96+Check one or more package then press the "Update" button. The package manager will update the selected packages from the maintainer's homepage(if available). The package must be installed first, a direct update although is possible, it's not allowed to prevent unresolved dependency error. <span style="color:red">**Please note:**</span> downloading/installing packages from external link is not without a risk. Only update the package if you trust the package maintainer.
97+
98+#### Difference between download/install/update
99+
100+Download/Install --\> Operations between you and the main repository.
101+
102+Update --\> Operations between you and the package maintainers.
103+
104+<figure>
105+<img src="OPM10.png" title="OPM10.png" />
106+<figcaption>OPM10.png</figcaption>
107+</figure>
108+
109+Video link: [Difference between download/install/update](https://www.youtube.com/watch?v=wiN2GoCvgjc)
110+
111+#### Cleanup local repository
112+
113+This operation will delete all non-installed packages/archives from the local repository. To cleanup the local repository press the "Cleanup" button.
114+
115+#### Create
116+
117+*This section is for package maintainers. First you must go to Options--\>Profiles and select package maintainer.*
118+
119+##### Create repository package
120+
121+To create a repository package press "Create repository package" menu item, then:
122+
123+- select the package main directory(package manager will recursively search for all package files inside the folder)
124+- select the repository package(root node)
125+ - choose category(obligatory)
126+ - type display name(optional)
127+ - home page(optional)
128+ - update link(optional, for more details see "Create JSON for updates"[1](http://wiki.freepascal.org/Online_Package_Manager#Create_JSON_for_updates)" below)
129+ - create JSON for updates(optional), has the same functionality as "Create JSON for updates"[2](http://wiki.freepascal.org/Online_Package_Manager#Create_JSON_for_updates)" dialog. It was also added here to speed up the process.
130+
131+<figure>
132+<img src="OPM15.png" title="OPM15.png" />
133+<figcaption>OPM15.png</figcaption>
134+</figure>
135+
136+- check each package you wish to include, adjust package info if necessary(lazarus/fpc compatibility, supported widgetset, etc)
137+
138+<figure>
139+<img src="OPM16.png" title="OPM16.png" />
140+<figcaption>OPM16.png</figcaption>
141+</figure>
142+
143+- press the create button, if all goes well you should get a zip and a json file. Upload somewhere the files and send the link to opm@lazarus-ide.org or
144+- press the submit button, the files are directly uploaded to a remote server.
145+
146+Every package will be accepted after a short check(malware, license, etc). Multiple versions of the same package is also allowed.
147+
148+##### Create JSON for updates
149+
150+To allow the user to update the package directly form your webpage, follow this steps:
151+
152+- Make sure your package is already in the main repository(see previous section)
153+- You can download and use the [[OPM External Update json Editor|Online Package Manager External Update json Editor]]
154+ - or via OnlinePackageManager:
155+
156+- Check the package, press the "Create JSON for upates" menu item then create the JSON.
157+
158+<figure>
159+<img src="OPM11.png" title="OPM11.png" />
160+<figcaption>OPM11.png</figcaption>
161+</figure>
162+
163+- Edit the JSON, upload to your webpage, then send me the link.
164+
165+The JSON will look like this:
166+
167+<figure>
168+<img src="OPM12.png" title="OPM12.png" />
169+<figcaption>OPM12.png</figcaption>
170+</figure>
171+
172+Editable items in the JSON:
173+
174+**"DownloadZipURL"** --\> Link to your new, updated package
175+
176+**"DisableInOPM"** --\> If you want to temporary disable your package, set this boolean to true. It's useful for maintenance, the package will be grayed out in the tree. The user cannot download/install/update the package.
177+
178+**"Version"/"ForceNotify"/"InternalVersion"** --\> To trigger an update message on the users computer, you can either:
179+
180+- Increase the **"Version"** number. Useful when you want to release a new version of the package.
181+- Set **"ForceNotify"** to true. Useful after a minor change in your source, that does not require a version change or in case of trunk version. To prevent continous error messages, **"ForceNotify"** must be used in combination with **"InternalVersion"**. After the user updates the package, OPM locally stores the **"InternalVersion"** value. If you want to trigger a new message, increase **"InternalVersion"** with one. If **"ForceNotify"** is true, **"Version"** is always ignored.
182+
183+The most common scenario is this:
184+
185+- Generate the JSON
186+- Modify **"DownloadZipURL"**
187+- Increase version number when necessary.
188+
189+Please note: After you edited the JSON the changes are not immediately visible in the tree. Usually it takes 1-2 min. It also depends on the users setting(Options--\>General--\>Check for package updates).
190+
191+#### Options
192+
193+To display the options dialog press the "Options" button.
194+
195+### Create a private repository
196+
197+In order to create a private repository please do the following:
198+
199+1\. First make sure profile "Package maintainer" is enabled in Options--\>Profiles, then open the private repository form(see screenshot below)
200+
201+<figure>
202+<img src="OPM17.png" title="OPM17.png" />
203+<figcaption>OPM17.png</figcaption>
204+</figure>
205+
206+2\. Press the "Create" button. Enter repository Name, Address(optional), Description(optional). Save the repository to an empty folder
207+
208+<figure>
209+<img src="OPM18.png" title="OPM18.png" />
210+<figcaption>OPM18.png</figcaption>
211+</figure>
212+
213+- If filled, the repository address(in this case <http://localhost/packages/>) is automatically added to available repository list(Options form)
214+
215+<figure>
216+<img src="OPM19.png" title="OPM19.png" />
217+<figcaption>OPM19.png</figcaption>
218+</figure>
219+
220+3\. Start to add/delete packages. You have two choices:
221+
222+a\. Create a new package via <http://wiki.freepascal.org/Online_Package_Manager#Create_repository_package>
223+
224+b\. Add a previously saved package
225+
226+<figure>
227+<img src="OPM20.png" title="OPM20.png" />
228+<figcaption>OPM20.png</figcaption>
229+</figure>
230+
231+4.You can also open a previously saved repository. The last repository is automatically opened on startup.
232+
233+5.Upload the files(packagelist.json, *.zip) to your local or remote server.
234+
235+6.Make sure the server is running, the change "Remote repository" in Options--\>General
236+
237+## see also
238+
239+- [OPM video about the install process](https://www.youtube.com/watch?v=IRJkyiOn3AA)
240+
241+---
242+*From the Free Pascal wiki, page "Online Package Manager", as it stood on 2020-04-28 after a change by GetMem, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history