# vim: syntax=spec # git_dir_name returns repository name derived from remote Git repository URL Name: nadybot # git_dir_version returns version based on commit and tag history of the Git project Version: 5.0.1 # This can be useful later for adding downstream patches Release: 3%{?dist} BuildArch: noarch # Basic description of the package Summary: A chat bot for the MMORPG Anarchy Online # License. Hopefully free or at least open-source. We assume GPLv2+ here. License: GPLv3+ # Home page of the project. Can also point to the public Git repository page. URL: https://github.com/Nadybot/Nadybot # Detailed information about the source Git repository and the source commit # for the created rpm package VCS: git+git@github.com:Nadybot/Nadybot#5b12c05c8a70e23b46862ea6ec4c0571d1c3b1eb:packages/rpm/ # git_dir_pack macro places the repository content (the source files) into a tarball # and returns its filename. The tarball will be used to build the rpm. Source: Nadybot %define php_prefix %{nil} %define php_exec php %if 0%{?rhel} > 1 %define php_prefix php74- %define php_exec php74 %endif BuildRequires: %{php_prefix}php-cli >= 7.4 BuildRequires: %{php_prefix}php-json BuildRequires: curl BuildRequires: sed BuildRequires: %{php_prefix}php-pdo BuildRequires: %{php_prefix}php-mysqlnd BuildRequires: %{php_prefix}php-bcmath BuildRequires: %{php_prefix}php-mbstring BuildRequires: %{php_prefix}php-xml %if 0%{?rhel} < 8 BuildRequires: systemd %else BuildRequires: systemd-rpm-macros %endif Requires(pre): shadow-utils Requires: %{php_prefix}php-cli >= 7.4 Requires: %{php_prefix}php-json Requires: %{php_prefix}php-pdo Requires: %{php_prefix}php-mysqlnd Requires: %{php_prefix}php-bcmath Requires: %{php_prefix}php-mbstring Requires: %{php_prefix}php-xml Requires: %{php_prefix}php-pecl-zip Requires: dialog %global debug_package %{nil} # More detailed description of the package %description This is a chat bot for the MMORPG Anarchy Online by Funcom %pre getent group nadybot >/dev/null || groupadd -r nadybot getent passwd nadybot >/dev/null || \ useradd -r -g nadybot -d /opt/nadybot -s /sbin/nologin \ -c "Unprivileged user to run nadybot" nadybot exit 0 # The following four sections already describe the rpm build process itself. # prep will extract the tarball defined as Source above and descend into it. %prep %setup -q -n Nadybot curl -o composer-stable.phar https://getcomposer.org/composer-stable.phar %{php_exec} composer-stable.phar install --no-dev %{php_exec} composer-stable.phar dumpautoload --no-dev --optimize rm -f composer-stable.phar sed -i'' -e 's|\$vars\[.enable_console_client.\].*|$vars["enable_console_client"] = 0;|g' conf/config.template.php sed -i'' -e 's|\$vars\[.default_module_status.\].*|$vars["default_module_status"] = 1;|g' conf/config.template.php sed -i'' -e 's|\$vars\[.DB Name.\].*|$vars["DB Name"] = $vars["name"] . ".db";|g' conf/config.template.php sed -i'' -e 's|\$vars\[.DB Host.\].*|$vars["DB Host"] = "%{_sharedstatedir}/nadybot/db/";|g' conf/config.template.php sed -i'' -e 's|.\./extras.|"%{_sharedstatedir}/nadybot/extras/" . $vars["name"]|g' conf/config.template.php sed -i'' -e 's|\$vars\[.cachefolder.\].*|$vars["cachefolder"] = "%{_sharedstatedir}/nadybot/cache/";|g' conf/config.template.php sed -i'' -e 's|\$vars\[.htmlfolder.\].*|$vars["htmlfolder"] = "%{_sharedstatedir}/nadybot/html/" . $vars["name"] . "/";|g' conf/config.template.php sed -i'' -e 's|\$vars\[.datafolder.\].*|$vars["datafolder"] = "%{_sharedstatedir}/nadybot/data/" . $vars["name"] . "/";|g' conf/config.template.php sed -i'' -e 's|\$vars\[.logsfolder.\].*|$vars["logsfolder"] = "/var/log/nadybot";|g' conf/config.template.php sed -i'' -e 's|\$vars\[.logsfolder.\].*|$vars["logsfolder"] = "/var/log/nadybot";|g' conf/config.template.php sed -i'' -e 's|/usr/bin/env php|/usr/bin/env %{php_exec}|g' packages/nadybot.service sed -i'' -e 's|/usr/bin/env php|/usr/bin/env %{php_exec}|g' packages/nadybot@.service sed -i'' -e 's|(php |(%{php_exec} |g' packages/nadybot # This will invoke `make` command in the directory with the extracted sources. %build # This will copy the files generated by the `make` command above into # the installable rpm package. %install mkdir -p %{buildroot}%{_sysconfdir}/nadybot mkdir -p %{buildroot}%{_sharedstatedir}/nadybot mkdir -p %{buildroot}%{_sharedstatedir}/nadybot/db mkdir -p %{buildroot}%{_sharedstatedir}/nadybot/cache mkdir -p %{buildroot}%{_sharedstatedir}/nadybot/extras mkdir -p %{buildroot}%{_sharedstatedir}/nadybot/html mkdir -p %{buildroot}%{_sharedstatedir}/nadybot/data mkdir -p %{buildroot}/opt/nadybot mkdir -p %{buildroot}/opt/nadybot/data mkdir -p %{buildroot}/opt/nadybot/conf mkdir -p %{buildroot}/var/log/nadybot find src -type d -exec install -d %{buildroot}/opt/nadybot/\{\} \; find src -type f -exec install -m 644 \{\} %{buildroot}/opt/nadybot/\{\} \; find vendor -type d -exec install -d %{buildroot}/opt/nadybot/\{\} \; find vendor -type f -exec install -m 644 \{\} %{buildroot}/opt/nadybot/\{\} \; install -m 644 main.php %{buildroot}/opt/nadybot/main.php install -m 644 data/text.mdb %{buildroot}/opt/nadybot/data/text.mdb install -m 644 conf/config.template.php %{buildroot}%{_sysconfdir}/nadybot/config.php install -m 644 conf/log4php.xml %{buildroot}/opt/nadybot/conf/log4php.xml install -D -m 644 packages/nadybot.service %{buildroot}%{_unitdir}/nadybot.service install -D -m 644 packages/nadybot@.service %{buildroot}%{_unitdir}/nadybot@.service install -D -m 755 packages/nadybot %{buildroot}%{_bindir}/nadybot # This lists all the files that are included in the rpm package and that # are going to be installed into target system where the rpm is installed. %files %defattr(644,nadybot,nadybot,755) %dir %{_sysconfdir}/nadybot %config %{_sysconfdir}/nadybot/config.php %attr(755,root,root) /opt/nadybot %attr(750,-,-) %dir /var/log/nadybot %dir %{_sharedstatedir}/nadybot %dir %{_sharedstatedir}/nadybot/cache %dir %{_sharedstatedir}/nadybot/db %dir %{_sharedstatedir}/nadybot/data %dir %{_sharedstatedir}/nadybot/extras %dir %{_sharedstatedir}/nadybot/html %attr(644,root,root) %{_unitdir}/nadybot.service %attr(644,root,root) %{_unitdir}/nadybot@.service %attr(755,root,root) %{_bindir}/nadybot %post %if 0%{?rhel} < 8 /bin/systemctl --system daemon-reload &> /dev/null || : %endif %if 0%{?fedora} || 0%{?rhel} >= 8 %systemd_post nadybot.service %endif %preun %if 0%{?fedora} || 0%{?rhel} >= 8 %systemd_preun nadybot.service %endif if [ "$1" -eq 0 ]; then rm -rf "%{_sharedstatedir}"/nadybot/cache/* rm -rf "%{_sharedstatedir}"/nadybot/db/* rm -rf "%{_sharedstatedir}"/nadybot/data/* rm -rf "%{_sharedstatedir}"/nadybot/extras/* rm -rf "%{_sharedstatedir}"/nadybot/html/* rm -rf /var/log/nadybot/* fi exit 0 %postun %if 0%{?rhel} < 8 /bin/systemctl --system daemon-reload &> /dev/null || : %endif %if 0%{?fedora} || 0%{?rhel} >= 8 %systemd_postun_with_restart apache-httpd.service %endif %changelog * Thu Mar 25 2021 Nadyita 5.0.1-1 - Support configuration of base paths - Support packaging as RPM and DEB * Sat Mar 20 2021 Nadyita 5.0.0-1 - Add possibility to set default values for alias parameters - Allow customization of the colors of tradebot channels - Completely rework the !perk command - Add the AI perks - Add actions given - Add grouping - Allow `!whatbuffs` to mark one-slotted items, nodrops and uniques - Support listing of all comments of a type - Symbiant revamp and fuzzy finding symbiant types with `!symb` command - Introduce reminders for `!notes` - Mark "Self Illumination" and "The Rihwen" as tradeskillable nanos - Ensure we don't have duplicate entries in players table - Integrate an exporter/importer for backups and bot transfers - Add configuration for raid add/raid kick messages - Configurable min length for points manipulation (`!points add`/`!point rem` reason) - `!raid kick` is now case-insensitive regarding the name to be kicked - Fix searching for non-existing skill in premade imps - Fix `!orghistory 0` - Fix DB format for waypoints in !rally, they didn't work after restarts - Fix for MySQL 5.5 and 5.6 - Fix Auction links for !loot command - Fix `!raid refund` help to properly show how it's used - Fixed "Soothing Herbs" proc classification - Reclassify some nanos to different locations - Fix Windows installer * Sat Feb 06 2021 Nadyita 5.0.0~RC.5-1 - Allow disabling mass tells in the bot (#69) - Support rate-limited proxy for when we send mass tells via more than 1 worker - Added guide for inferno key pocket bosses - Merge WBF_MODULE into standard modules (#73) You can now use `!wbf` like `!whatbuffs` but will only see items usable by froobs - Introduce the `!icc` command to query current or upcoming arbiter events - Support the new NadyUI web chat (#78) - Add new raffle features (#83) - Raffle admin menu - Allow turning off raffle timeout in config options - Support raffle re-announcements - Allow mapping org ranks to bot access levels (#84) - Add new `!package` command for dynamic installation and update of optional modules from https://pkg.aobots.org (#98) - Colorize item matches if only a certain QL(range) matches the search term (#101) - Generic `COMMENT_MODULE` (#102) - Replaces the `REPUTATION_MODULE`. - Comments can be configured to be shareable - Comments can be bulk queried for everyone in the raid with `!raid comments` - Have !online list show who's in the raid if configured. Multiple formats available. - Add a setting to always ban all alts of a player (#108) - Console enhancements: - Support nano-links in the console - Support colors in the console - Fix the dynadb and display (#71) - Fix alignment of `!updateorg` timer to always be at 10 mins after last update - Fix bots relaying their own Discord messages - Fix nanos: - Fixed and added multiple locations. A lot of inf sanctuary nanos were also buyable in Pandemonium garden. - Make overview better to read - Reclassified Vehicle nanos - Added legacy Adventurer nanos and Playful Cub (Other) - Fix crash in Discord output when more than 10 parts were sent - Support SQLite < 3.23.0 (#86) - Fix all known Php8 issues (#109) and always build a php8 docker image for testing purpose (#112) - Support db reconnects (#110) Bot can now start without DB and will detect if the DB was restarted - Adhere to Discord rate-limits when sending messages via PMs or channels (#113) - Always allow alts confirm/decline (#68) - Add "Inert Reaper of Time" to bossloot - Only show the loot searched for in `!bossloot` and not everything the bosses drop - Added Go LFT link to raid information window (#74) - Support worker pong and command negotiation (#75) - Move Nucleus Basalis ring into ring category - Allow searching for tower sites without space after zone (`!lc PW8` instead of `!lc PW 8`) - Reduce and check the required PHP extensions on startup (#111) No more OpenSSL module * Sun Dec 27 2020 Nadyita 5.0~RC4-1 - Fix crash in `!bio` command - Fix for dynamic settings not showing values - Final fix for column exist in MySQL - Support new AOChatProxy and [its mass tell features](https://github.com/Nadybot/Nadybot/wiki/AOChatProxy) - Allow to configure which tradebot channels to relay - Add subway and totw loot to boss command - Add documentation to modules to show in NadyUI and the `!config ` - Convert Buddylist-entries to objects - Track if orglist is ready, so you get proper "please wait" messages - Use a different algorithm to send out mass messages and invites - Allow elegant overwriting of base instances * Sun Dec 20 2020 Nadyita 5.0~RC3-1 - Bugfix release to avoid looped conversion of alts table * Sat Dec 19 2020 Nadyita 5.0~RC2-1 - Do not send alt validation request from multiple bots - Prevent a rare hanging scenario when reading past the MDB EOF - Fix Discord for some 32bit systems when the bot was member in a lot of servers - Never exit due to PHP 7.4 type errors - Lots of crash scenarios fixed - Allow `!alts main ` again and allow confirmation of alt and/or main - Speed up orglist by roughly 30% by not sending uid lookup packets twice - Try to align guild roster updates with the Funcom export time, so we're always updating 10 mins after them - Handle custom emojis in Discord, delete unsupported chars from Discord names and properly support `’` - Add `!assist ` for a quick alternative to `!caller add ` - Add more buttons to callers - Use cache for ao-universe guides - Introduce the ability to execute commands via the API, fully supported by NadyUI which now has a command line - Remove SSL-support from the webserver as it's untested - Switch default neutral color to old one - Remove old and outdated guides and spice up the remaining ones * Sun Dec 06 2020 Nadyita 5.0~RC1-1 - Move last bits of sync HTTP calls to callbacks. This should finally fix all outstanding Windows bugs and speed up `!orglist ` by large. - Move more tells to spam messages to allow load-balancing them - Tower attacks warn about fake names now - Pre-made imps are now (hopefully) displayed better and also fixed 2 wrong ones. 1HE shiny head would be too odd… - Allow searching via skill aliases in the pre-made imps now, so `!premade mc` really works - Any emoji that's send on discord will now be converted to `::` if it cannot be displayed in AO - Add new command `!reward ` to manage pre-defined rewards which can then be used with `!raid reward`, so you can use `!raid reward beast` if you defined it before. This will now also allow to log reasons for why a raid reward was given with `!raid reward `. - The console now also allows the use of the symbol prefix, so you can easily copy & paste commands - Introduce the ability to set a separate prefix for Discord and allow to turn off messages when a command is unknown. - Disable the console on Windows as it doesn't work without blocking everything :o( - Enable the WebUI per default now, only listening on localhost - Fixed more 32bit issues - Fix links in discord headers not working - Fix a MySQL crash when a fake attacker charmed a pet with a too long name - Fix a rare Discord crash when someone joins an unknown voice channel - Fixed a crash when GSP's provider had erroneous JSON - Fix min-level requirement check for commands in tells - Fix tower attacks not recording defending org - Break too long messages into chunks for Discord, so messages aren't dropped any more * Fri Nov 27 2020 Nadyita 5.0~beta4-1 - Fix index creation for older MySQL versions * Fri Nov 27 2020 Nadyita 5.0~beta3-1 - Support Windows and include an installer for PHP - Support 32bit - Support older MySQL alongside MariaDB - Switch from MyISAM to aria as default if available - Support PHP8 - `!bossloot ` will now just log an error instead of crashing when an item cannot be found - Add rate-limit functionality to the `LIMITS` module so you can auto-kick/ban/ignore players that are sending commands at a too high rate - Serialize outgoing Discord messages, so the order is always guaranteed to be correct. This slows sending messages a bit down as we're not sending multiple messages in parallel anymore, but at least they arrive in the correct order. - Support Discord mentions - Allow the use of `!extauth request` outside of Discord DMs - Fix SQL error in `!config cmd disable/enable` command - Fix the `LEVEL_MODULE` ranges - Switch even more HTTP lookups to async, so they don't slow down the bot, greatly increasing responsiveness when the `ORGLIST_MODULE` is enabled - Reduced bot startup by adding some long overdue indexes to some core tables and not always adding all recipes yet again - Add a `!track online` command alongside a more customizable tracker output - Move the StdIn console into its own core module and fall back to buffered stdin for platforms wirthout readline * Sun Nov 15 2020 Nadyita 5.0~beta2-1 - Prevent unauthorized access to Discord token - Support Windows - Allow to turn off afk and brb without prefix * Sat Nov 14 2020 Nadyita 5.0 beta-1 - First beta release