Online Package Manager/ru

From Free Pascal wiki
Jump to navigationJump to search

Template:Translate

О плагине

Online Package Manager(OPM) - это инструмент, который автоматизирует процесс установки, обновления и настройки пакетов Lazarus. Пакеты хранятся в главном хранилище (см. столбец хранилища) в виде zip-файлов вместе с файлом JSON. JSON содержит всю необходимую информацию о пакетах. По запросу пакеты загружаются/извлекаются/компилируются/устанавливаются в IDE. Если доступно, также возможно обновить ранее установленный пакет с веб-страницы разработчика (см. столбец обновления). Здесь также есть веб-версия репозитория пакетов Lazarus.

Пожалуйста, имейте ввиду:

OPM читает описание пакета из файла lpk. Я могу понять, что описание многих пакетов очень минималистично или вообще отсутствует, но я ничего не могу с этим поделать. Не разрешается изменять описание пакета или любое другое свойство в этом отношении без согласия на то разработчика пакета. Более того протестировать каждый пакет, а затем написать подробное описание просто нереально.

Screenshot

OPM6.png

OPM7.png

License

GNU General Public License

Загрузка

Online package manager является частью исходников Lazarus, расположен в каталоге ($LazarusDir)/components/onlinepackagemanager.

Системные требования / зависимости

  • FPC 3.0.0 или новее
  • Lazarus 1.8 или новее
  • Вы можете скачать старую версию для серии 1.6: OPM 1.6
  • Эти версии были доступны на момент написания этого обновления.
  • Проверено на следующем наборе виджетов: win32/64, gtk2, carbon, qt(win)
  • Менеджер пакетов не имеет зависимости ни от одного внешнего пакета

Установка

В окне Lazarus "Install/Uninstall Packages" выберите «OnlinePackageManager» из списка доступных пакетов, нажмите «Install selection» и затем пересоберите IDE.

Страница поддержки

http://forum.lazarus.freepascal.org/index.php/topic,34297.0.html

Использование менеждера пакетов

Как начать

Перейдите в Lazarus Menu⇒Package(Пакет)⇒Online Package Manager(Сетевой диспетчер пакетов) (горячие клавиши: Ctrl+Alt+ Shift+O). При запуске менеджер пакетов автоматически загрузит список доступных пакетов из репозитория, который отображается в виде дерева (см. скриншоты выше).

Фильтрация дерева/Поиск пакетов

OPM3.png

Вы можете отфильтровать список пакетов по:

  • имени пакета
  • файлу пакета(.lpk)⇒пакет репозитория может содержать несколько файлов lpk
  • категории пакета
  • статусу пакета
  • версии
  • описанию
  • автору
  • совместимостью с версией Lazarus
  • совместимостью с версией FPC
  • поддерживаемым виджетсетам
  • типу пакета
  • зависимостям
  • виду лицензии

Operation with packages

OPM4.png

Refresh package list

Press the "Refresh" button to update the package list.

Download package

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.

Install a package

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+.

Update a package

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. Please note: downloading/installing packages from external link is not without a risk. Only update the package if you trust the package maintainer.

Difference between download/install/update

Download/Install --> Operations between you and the main repository.

Update --> Operations between you and the package maintainers.

OPM10.png

Video link: Difference between download/install/update

Cleanup local repository

This operation will delete all non-installed packages/archives from the local repository. To cleanup the local repository press the "Cleanup" button.

Create

This section is for package maintainers. First you must go to Options-->Profiles and select package maintainer.

Create repository package

To create a repository package press "Create repository package" menu item, then:

  • select the package main directory(package manager will recursively search for all package files inside the folder)
  • select the repository package(root node)
    • choose category(obligatory)
    • type display name(optional)
    • home page(optional)
    • update link(optional, for more details see "Create JSON for updates"[1]" below)
    • create JSON for updates(optional), has the same functionality as "Create JSON for updates"[2]" dialog. It was also added here to speed up the process.

OPM15.png

  • check each package you wish to include, adjust package info if necessary(lazarus/fpc compatibility, supported widgetset, etc)

OPM16.png

  • 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 getmem1@gmail.com or
  • press the submit button, the files are directly uploaded to a remote server.

Every package will be accepted after a short check(malware, license, etc). Multiple versions of the same package is also allowed.

Create JSON for updates

To allow the user to update the package directly form your webpage, follow this steps:

  • Check the package, press the "Create JSON for upates" menu item then create the JSON.

OPM11.png

  • Edit the JSON, upload to your webpage, then send me the link.

The JSON will look like this:

OPM12.png

Editable items in the JSON:

"DownloadZipURL" --> Link to your new, updated package

"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.

"Version"/"ForceNotify"/"InternalVersion" --> To trigger an update message on the users computer, you can either:

  • Increase the "Version" number. Useful when you want to release a new version of the package.
  • 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.

The most common scenario is this:

  • Generate the JSON
  • Modify "DownloadZipURL"
  • Increase version number when necessary.

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).

Options

To display the options dialog press the "Options" button.

Create a private repository

In order to create a private repository please do the following:

1. First make sure profile "Package maintainer" is enabled in Options-->Profiles, then open the private repository form(see screenshot below)

OPM17.png


2. Press the "Create" button. Enter repository Name, Address(optional), Description(optional). Save the repository to an empty folder

OPM18.png


  • If filled, the repository address(in this case http://localhost/packages/) is automatically added to available repository list(Options form)

OPM19.png


3. Start to add/delete packages. You have two choices:

a. Create a new package via http://wiki.freepascal.org/Online_Package_Manager#Create_repository_package

b. Add a previously saved package

OPM20.png


4.You can also open a previously saved repository. The last repository is automatically opened on startup.

5.Upload the files(packagelist.json, *.zip) to your local or remote server.

6.Make sure the server is running, the change "Remote repository" in Options-->General

see also