Bug 261521

Summary: databases/mysql80-server: Does not install LOCALBASE/bin/mysql_secure_installation
Product: Ports & Packages Reporter: Sean McBride <sean>
Component: Individual Port(s)Assignee: Jochen Neumeister <joneum>
Status: Closed FIXED    
Severity: Affects Many People CC: chris, joneum, tech-lists
Priority: --- Keywords: needs-qa
Version: LatestFlags: koobs: maintainer-feedback? (joneum)
koobs: merge-quarterly?
Hardware: Any   
OS: Any   
URL: https://forums.freebsd.org/threads/created-famp-server-from-scratch-but-mysql_secure_installation-is-missing.83867/
Attachments:
Description Flags
patch none

Description Sean McBride 2022-01-27 18:10:04 UTC
Repro steps:

- create a fresh FreeBSD 13 VM
- do basic installation
- create VM snapshot
- pkg install mysql57-client mysql57-server
- run:

root@test:/home/test #	find / -iname mysql_secure_installation
/usr/local/bin/mysql_secure_installation

mysql_secure_installation exists as expected.

- rollback the VM to the snapshot
- pkg install mysql80-client mysql80-server
- search for mysql_secure_installation again
- mysql_secure_installation is NOT present, but interestingly the man page exists

This used to work.  I have running mysql_secure_installation in my FAMP setup notes, and now that I'm creating a new server I found this issue.

See also:
https://forums.freebsd.org/threads/created-famp-server-from-scratch-but-mysql_secure_installation-is-missing.83867/
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2022-01-28 01:03:17 UTC
Are any other databases/* ports affected in the same way?
Comment 2 Sean McBride 2022-01-28 01:59:14 UTC
I've never used any other database, but I know mariadb is a fork so tried `mariadb105-server-10.5.13` and with it `mysql_secure_installation` in installed. HTH.
Comment 3 Sean McBride 2022-01-28 15:14:20 UTC
Does the mysql_secure_installation file that should be getting installed exist in git somewhere so I can install it locally manually and get myself unstuck?
Comment 4 Christos Chatzaras 2022-01-28 15:20:56 UTC
MySQL doesn't have a git repository. Try to download https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-boost-8.0.28.tar.gz and check where the script is located.
Comment 5 Sean McBride 2022-01-28 16:26:13 UTC
Thanks for the link. There are a few files with mysql_secure_installation in their name, but none of them are shell scripts.  One is C code.  Maybe it's not a shell script anymore (though it is with the MariaDB test I installed).
Comment 6 Sean McBride 2022-02-03 00:29:16 UTC
Could this change be the bug:

https://github.com/freebsd/freebsd-ports/blob/ea739e8990792020fa9fcdc83adcd5854095ea7d/databases/mysql80-server/files/patch-client_CMakeLists.txt

line 59 is:

```
+IF(NOT_WITHOUT_SERVER)
```

but I think should be:

```
+IF(NOT WITHOUT_SERVER)
```
Comment 7 Sean McBride 2022-02-08 03:45:04 UTC
Created attachment 231627 [details]
patch

I've confirmed that was the problem, and here's a patch.
Comment 8 Sean McBride 2022-02-11 01:28:48 UTC
Jochen, any comments on my patch?  What can I do to help move it forward?  Thanks.
Comment 9 Sean McBride 2022-03-03 23:24:51 UTC
Friendly ping...

This bug:
- is a regression
- is simple and straightforward
- has a patch (by me)
- has been tested (by me)
Comment 10 Jochen Neumeister freebsd_committer freebsd_triage 2022-03-04 16:01:18 UTC
Allready landed: https://cgit.freebsd.org/ports/commit/?id=c4ac829e974e1c9b1de8348588d73a3c1a166a22